home *** CD-ROM | disk | FTP | other *** search
Java Source | 1996-09-10 | 657 b | 27 lines |
- // Copyright(c) 1996 ObjectSpace, Inc.
- // Portions Copyright(c) 1995, 1996 Hewlett-Packard Company.
-
- package jgl;
-
- /**
- * SelectFirst is a unary function that assumes that its operand is a Pair and returns
- * its first instance variable.
- * <p>
- * @see jgl.SelectSecond
- * @version 1.1
- * @author ObjectSpace, Inc.
- */
-
- public final class SelectFirst implements UnaryFunction
- {
- /**
- * Return the first instance variable of my operand.
- * @param object The operand, which must be an instance of Pair.
- * @return object.first
- */
- public Object execute( Object object )
- {
- return ((Pair) object).first;
- }
- }
-