ti.chimera.registry
Class OrNodeContract

java.lang.Object
  extended byti.chimera.registry.OrNodeContract
All Implemented Interfaces:
NodeContract

public class OrNodeContract
extends java.lang.Object
implements NodeContract

A node contract that is composed of multiple other contracts using the or (||) 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
OrNodeContract(NodeContract[] ncs)
          Class Constructor, construct a node contract that is the OR of all the elements in the ncs array.
OrNodeContract(NodeContract a, NodeContract b)
          Class Constructor, construct a node contract that is the OR of a or 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

OrNodeContract

public OrNodeContract(NodeContract a,
                      NodeContract b)
Class Constructor, construct a node contract that is the OR of a or b

Parameters:
a - node contract
b - node contract

OrNodeContract

public OrNodeContract(NodeContract[] ncs)
Class Constructor, construct a node contract that is the OR 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