home *** CD-ROM | disk | FTP | other *** search
Java Source | 1996-09-10 | 648 b | 25 lines |
- // Copyright(c) 1996 ObjectSpace, Inc.
- // Portions Copyright(c) 1995, 1996 Hewlett-Packard Company.
-
- package jgl;
-
- /**
- * ToString is a unary function that returns its operand as a String.
- * <p>
- * @version 1.1
- * @author ObjectSpace, Inc.
- */
-
- public final class ToString implements UnaryFunction
- {
- /**
- * Return my argument as a String, or "null" if the operand is null.
- * @param object The operand.
- * @return A String that describes the operand, using the standard Java toString() method.
- */
- public Object execute( Object object )
- {
- return object == null ? "null" : object.toString();
- }
- }
-