com.metamatrix.core.id
Class IntegerID

java.lang.Object
  extended by com.metamatrix.core.id.IntegerID
All Implemented Interfaces:
ObjectID, java.io.Serializable, java.lang.Comparable

public class IntegerID
extends java.lang.Object
implements ObjectID, java.io.Serializable

See Also:
Serialized Form

Field Summary
static java.lang.String PROTOCOL
           
 
Fields inherited from interface com.metamatrix.core.id.ObjectID
DELIMITER
 
Constructor Summary
protected IntegerID(int id)
           
 
Method Summary
 int compareTo(java.lang.Object obj)
          Compares this object to another.
 boolean equals(java.lang.Object obj)
          /** Returns true if the specified object is semantically equal to this instance.
 java.lang.String getProtocol()
          Return the name of the protocol that this factory uses.
 int getValue()
           
 int hashCode()
          Get hash code for object
 java.lang.String toString()
          Returns a string representing the current state of the object.
 java.lang.String toString(char delim)
          Returns a string representing the current state of the object.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

PROTOCOL

public static final java.lang.String PROTOCOL
See Also:
Constant Field Values
Constructor Detail

IntegerID

protected IntegerID(int id)
Method Detail

hashCode

public int hashCode()
Get hash code for object

Overrides:
hashCode in class java.lang.Object
Returns:
Hash code

equals

public boolean equals(java.lang.Object obj)
/** Returns true if the specified object is semantically equal to this instance. Note: this method is consistent with compareTo().

Overrides:
equals in class java.lang.Object
Parameters:
obj - the object that this instance is to be compared to.
Returns:
whether the object is equal to this object.

compareTo

public int compareTo(java.lang.Object obj)
Compares this object to another. If the specified object is not an instance of the LongID class, then this method throws a ClassCastException (as instances are comparable only to instances of the same class). Note: this method is consistent with equals(), meaning that (compare(x, y)==0) == (x.equals(y)).

Specified by:
compareTo in interface ObjectID
Specified by:
compareTo in interface java.lang.Comparable
Parameters:
obj - the object that this instance is to be compared to; may not be null.
Returns:
a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object, respectively.
Throws:
java.lang.ClassCastException - if the specified object's type prevents it from being compared to this instance.

toString

public java.lang.String toString()
Returns a string representing the current state of the object.

Specified by:
toString in interface ObjectID
Overrides:
toString in class java.lang.Object
Returns:
the string representation of this instance.

toString

public java.lang.String toString(char delim)
Description copied from interface: ObjectID
Returns a string representing the current state of the object.

Specified by:
toString in interface ObjectID
Parameters:
delim - the delimiter that should be used
Returns:
the string representation of this instance.
See Also:
ObjectID.toString(char)

getProtocol

public java.lang.String getProtocol()
Return the name of the protocol that this factory uses.

Specified by:
getProtocol in interface ObjectID
Returns:
the protocol name

getValue

public int getValue()


Copyright © 2009. All Rights Reserved.