ti.chimera.registry
Class TypeNodeContract

java.lang.Object
  extended byti.chimera.registry.TypeNodeContract
All Implemented Interfaces:
NodeContract
Direct Known Subclasses:
ColorNodeContract, FontNodeContract

public class TypeNodeContract
extends java.lang.Object
implements NodeContract

A NodeContract which enforces that a value is an instanceof a specified class.

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
TypeNodeContract(java.lang.Class type)
          Class Constructor.
 
Method Summary
 boolean accepts(java.lang.Object value)
          Determine if the specified value meets this contract.
 java.lang.Class getType()
          Get the type.
 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

TypeNodeContract

public TypeNodeContract(java.lang.Class type)
Class Constructor.

Parameters:
type - the type
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

getType

public java.lang.Class getType()
Get the type.


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