asd_library
Class BaseObject

java.lang.Object
  |
  +--asd_library.BaseObject
All Implemented Interfaces:
java.lang.Comparable

public class BaseObject
extends java.lang.Object
implements java.lang.Comparable

Wrapper class for use with generic data structures.


Constructor Summary
BaseObject(int k)
          Constructs the BaseObject.
 
Method Summary
 int compareTo(java.lang.Object bo)
          Implements the compareTo method.
 boolean equals(BaseObject anotherBaseObject)
          Implements the equals method.
 int intValue()
          Gets the stored int value.
 void setKey(int k)
          Sets key to k
 java.lang.String toString()
          Implements the toString method.
 void visit()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BaseObject

public BaseObject(int k)
Constructs the BaseObject.

Parameters:
k - the initial value.
Method Detail

setKey

public void setKey(int k)
Sets key to k

Parameters:
k -

intValue

public int intValue()
Gets the stored int value.

Returns:
the stored value.

compareTo

public int compareTo(java.lang.Object bo)
Implements the compareTo method.

Specified by:
compareTo in interface java.lang.Comparable
Parameters:
bo - the other BaseObject object.
Returns:
0 if two objects are equal; less than zero if this object is smaller; greater than zero if this object is larger.
Throws:
java.lang.ClassCastException - if bo is not a BaseObject.

toString

public java.lang.String toString()
Implements the toString method.

Overrides:
toString in class java.lang.Object
Returns:
the String representation.

visit

public void visit()

equals

public boolean equals(BaseObject anotherBaseObject)
Implements the equals method.

Parameters:
anotherBaseObject - the second BaseObject.
Returns:
true if the objects are equal, false otherwise.
Throws:
java.lang.ClassCastException - if anotherBaseObject is not a BaseObject.