home *** CD-ROM | disk | FTP | other *** search
Java Source | 1996-09-10 | 796 b | 28 lines |
- // Copyright(c) 1996 ObjectSpace, Inc.
- // Portions Copyright(c) 1995, 1996 Hewlett-Packard Company.
-
- package jgl;
-
- /**
- * LogicalAnd is a binary predicate that returns true if both operands are equal to
- * Boolean.TRUE.
- * <p>
- * @see jgl.LogicalOr
- * @version 1.1
- * @author ObjectSpace, Inc.
- */
-
- public final class LogicalAnd implements BinaryPredicate
- {
- /**
- * Perform a logical AND.
- * @param first The first operand, which must be an instance of Boolean.
- * @param second The second operand, which must be an instance of Boolean.
- * @return true if both operands are equal to Boolean.TRUE.
- */
- public boolean execute( Object first, Object second )
- {
- return ((Boolean) first).booleanValue() && ((Boolean) second).booleanValue();
- }
- }
-