com.ohrasys.cad.bnf
Class BNFTestableObject

java.lang.Object
  extended by com.ohrasys.cad.bnf.BNFTestableObject

public abstract class BNFTestableObject
extends java.lang.Object

An abstract wrapper class used to wrap objects such that a token may be easily retrieved


Constructor Summary
BNFTestableObject(java.lang.Object data)
          Creates a new BNFTestableObject object.
 
Method Summary
 boolean equals(java.lang.Object obj)
          A method to determine if this object is equivalent to another
 java.lang.Object getData()
          Returns the underlying data object
abstract  int getToken()
          An abstract method to retrieve a token from the underlying data object
 int hashCode()
          Returns a unique hashCode for the object
 void setData(java.lang.Object obj)
          Sets the underlying data
 java.lang.String toString()
          Returns a text representation of this object
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BNFTestableObject

public BNFTestableObject(java.lang.Object data)
Creates a new BNFTestableObject object.

Parameters:
data - The object to wrap
Method Detail

getToken

public abstract int getToken()
An abstract method to retrieve a token from the underlying data object

Returns:
An integer token used to represent the object

equals

public boolean equals(java.lang.Object obj)
A method to determine if this object is equivalent to another

Overrides:
equals in class java.lang.Object
Parameters:
obj - The object to compare against
Returns:
true if both objects are instances of BNFTestableObjects and the underlying data objects are equal

getData

public java.lang.Object getData()
Returns the underlying data object

Returns:
The underlying data object

hashCode

public int hashCode()
Returns a unique hashCode for the object

Overrides:
hashCode in class java.lang.Object
Returns:
The hash code of the underlying data object

setData

public void setData(java.lang.Object obj)
Sets the underlying data

Parameters:
obj - The new underlying data object

toString

public java.lang.String toString()
Returns a text representation of this object

Overrides:
toString in class java.lang.Object
Returns:
A text representation of the underlying data object