Main Page | Packages | Class Hierarchy | Alphabetical List | Class List | File List | Class Members

BNFTestableObject Class Reference

Collaboration diagram for BNFTestableObject:

Collaboration graph
[legend]
List of all members.

Detailed Description

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

Author:
Author
tvaline
Version:
Revision
1.10
,
Date
2005/03/31 22:13:17

Definition at line 28 of file BNFTestableObject.java.

Public Member Functions

 BNFTestableObject (Object data)
 Creates a new BNFTestableObject object.
boolean equals (Object obj)
 A method to determine if this object is equivalent to another.
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 (Object obj)
 Sets the underlying data.
String toString ()
 Returns a text representation of this object.


Constructor & Destructor Documentation

BNFTestableObject Object  data  ) 
 

Creates a new BNFTestableObject object.

Parameters:
data The object to wrap

Definition at line 37 of file BNFTestableObject.java.

00037 {this.data = data;}


Member Function Documentation

boolean equals Object  obj  ) 
 

A method to determine if this object is equivalent to another.

Parameters:
obj The object to compare against
Returns:
true if both objects are instances of BNFTestableObjects and the underlying data objects are equal

Definition at line 54 of file BNFTestableObject.java.

References BNFTestableObject.getData().

00054                                     {
00055     if(!(obj instanceof BNFTestableObject)){return false;}
00056     else{return data.equals(((BNFTestableObject)obj).getData());}
00057   }

Object getData  ) 
 

Returns the underlying data object.

Returns:
The underlying data object

Definition at line 64 of file BNFTestableObject.java.

Referenced by BNFTestableObject.equals().

00064 {return this.data;}

abstract int getToken  )  [pure virtual]
 

An abstract method to retrieve a token from the underlying data object.

Returns:
An integer token used to represent the object

Referenced by BNFNoFallthruTest.test().

int hashCode  ) 
 

Returns a unique hashCode for the object.

Returns:
The hash code of the underlying data object

Definition at line 71 of file BNFTestableObject.java.

00071 {return data.hashCode();}

void setData Object  obj  ) 
 

Sets the underlying data.

Parameters:
obj The new underlying data object

Definition at line 78 of file BNFTestableObject.java.

00078 {this.data = obj;}

String toString  ) 
 

Returns a text representation of this object.

Returns:
A text representation of the underlying data object

Definition at line 85 of file BNFTestableObject.java.

00085 {return data.toString();}


The documentation for this class was generated from the following file:
Generated on Sun Nov 13 10:13:12 2005 for JavaBackus-NaurTestAPI(JBNT) by  doxygen 1.4.2