home *** CD-ROM | disk | FTP | other *** search
/ ActiveX Programming Unleashed CD / AXU.iso / jgl_1_1 / jgl_1_1.exe / src / SelectSecond.java < prev    next >
Encoding:
Java Source  |  1996-09-10  |  662 b   |  27 lines

  1. // Copyright(c) 1996 ObjectSpace, Inc.
  2. // Portions Copyright(c) 1995, 1996 Hewlett-Packard Company.
  3.  
  4. package jgl;
  5.  
  6. /**
  7.  * SelectSecond is a unary function that assumes that its operand is a Pair and returns
  8.  * its second instance variable.
  9.  * <p>
  10.  * @see jgl.SelectFirst
  11.  * @version 1.1
  12.  * @author ObjectSpace, Inc.
  13.  */
  14.  
  15. public final class SelectSecond implements UnaryFunction
  16.   {
  17.   /**
  18.    * Return the second instance variable of my operand.
  19.    * @param object The operand, which must be an instance of Pair.
  20.    * @return object.second
  21.    */
  22.   public Object execute( Object object )
  23.     {
  24.     return ((Pair) object).second;
  25.     }
  26.   }
  27.