home *** CD-ROM | disk | FTP | other *** search
Java Source | 1996-09-10 | 846 b | 27 lines |
- // Copyright(c) 1996 ObjectSpace, Inc.
- // Portions Copyright(c) 1995, 1996 Hewlett-Packard Company.
-
- package jgl;
-
- /**
- * ModulusInteger is a binary function object that assumes that both of its operands are
- * instances of Integer and returns the first operand modulus the second operand.
- * <p>
- * @version 1.1
- * @author ObjectSpace, Inc.
- */
-
- public final class ModulusInteger implements BinaryFunction
- {
- /**
- * Return the first operand modulus the second operand.
- * @param first The first operand, which must be an instance of Integer.
- * @param second The second operand, which must be an instance of Integer.
- * @return first % second
- */
- public Object execute( Object first, Object second )
- {
- return new Integer( ((Integer) first).intValue() % ((Integer) second).intValue() );
- }
- }
-