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