unc.cdva.utils
Class Id

java.lang.Object
  extended by unc.cdva.utils.Id

public class Id
extends java.lang.Object

Class which creates a unique Id for each of the interactive items of the game

Author:
Dan

Constructor Summary
Id(Id copyId)
          copy constructor, creates a deep copy.
Id(long value)
          Constructor which sets the Id to the sent value
 
Method Summary
 boolean equals(java.lang.Object rhs)
          Checks if rhs is equal to this object
 long getValue()
           
 int hashCode()
          Returns a new number found based on the Id
 java.lang.String toString()
          Turns the Id into a string
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Id

public Id(long value)
Constructor which sets the Id to the sent value

Parameters:
value - value to set to the Id

Id

public Id(Id copyId)
copy constructor, creates a deep copy.

Parameters:
copyId - The id who's contents should be copied to this new id obj.
Method Detail

getValue

public long getValue()
Returns:
Id

hashCode

public int hashCode()
Returns a new number found based on the Id

Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object rhs)
Checks if rhs is equal to this object

Overrides:
equals in class java.lang.Object
Parameters:
rhs -

toString

public java.lang.String toString()
Turns the Id into a string

Overrides:
toString in class java.lang.Object