ti.chimera.registry
Class AndNodeContract

java.lang.Object
  extended by ti.chimera.registry.AndNodeContract
All Implemented Interfaces:
NodeContract

public class AndNodeContract
extends java.lang.Object
implements NodeContract

A node contract that is composed of multiple other contracts using the and (&&) operator.

Version:
0.1
Author:
;Rob Clark;a0873619;San Diego;;

Field Summary
 
Fields inherited from interface ti.chimera.registry.NodeContract
BOOLEAN_CONTRACT, NULL_CONTRACT, NUMBER_CONTRACT, STRING_CONTRACT
 
Constructor Summary
AndNodeContract(NodeContract[] ncs)
          Class Constructor, construct a node contract that is the AND of all the elements in the ncs array.
AndNodeContract(NodeContract a, NodeContract b)
          Class Constructor, construct a node contract that is the AND of a and b
 
Method Summary
 boolean accepts(java.lang.Object value)
          Determine if the specified value meets this contract.
 java.lang.String toString()
          The contract implementation should overload toString so the contract can be displayed to the user in a sane format, for use in error messages, etc.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AndNodeContract

public AndNodeContract(NodeContract a,
                       NodeContract b)
Class Constructor, construct a node contract that is the AND of a and b

Parameters:
a - node contract
b - node contract

AndNodeContract

public AndNodeContract(NodeContract[] ncs)
Class Constructor, construct a node contract that is the AND of all the elements in the ncs array.

Parameters:
ncs - node contracts
Method Detail

accepts

public boolean accepts(java.lang.Object value)
Determine if the specified value meets this contract.

Specified by:
accepts in interface NodeContract
Parameters:
value - the value to check
Returns:
true if meets contract

toString

public java.lang.String toString()
The contract implementation should overload toString so the contract can be displayed to the user in a sane format, for use in error messages, etc.

Specified by:
toString in interface NodeContract
Overrides:
toString in class java.lang.Object