home *** CD-ROM | disk | FTP | other *** search
/ Symantec Visual Cafe for Java 2.5 / symantec-visual-cafe-2.5-database-dev-edition.iso / Extras / OSpace / jgl.exe / jgl_2_0 / src / COM / objectspace / jgl / SelectFirst.java < prev    next >
Encoding:
Java Source  |  1997-03-14  |  696 b   |  27 lines

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