All Packages Class Hierarchy This Package Previous Next Index
Class ants.TypeID
java.lang.Object
|
+----ants.TypeID
- public final class TypeID
- extends Object
Capsule, Method, CodeGroup and Protocol identifiers.
This class wraps 128 bit MD5 hashes stored in byte arrays.
-
TypeID(byte[], int)
- Construct and initialize by deep copy
-
compare(TypeID)
- Compare two TypeIDs
-
equals(Object)
-
-
hashCode()
-
-
intern()
- Intern a TypeID and return its cannonical value
-
sortVector(Vector)
- Sort a vector of TypeIDs, ranking them with the compare method.
-
toString()
-
-
unwrap()
- Unwrap, returning the inner byte array
-
wrap(byte[])
- Construct and initialize by shallow copy.
TypeID
public TypeID(byte buf[],
int offset)
- Construct and initialize by deep copy
hashCode
public int hashCode()
- Overrides:
- hashCode in class Object
equals
public boolean equals(Object obj)
- Overrides:
- equals in class Object
intern
public TypeID intern()
- Intern a TypeID and return its cannonical value
compare
public int compare(TypeID t)
- Compare two TypeIDs
- Returns:
- s -1 (this < t), 0 (this.equals(t), 1 (this > t)
sortVector
public static void sortVector(Vector ids)
- Sort a vector of TypeIDs, ranking them with the compare method.
Good for short vectors only -- implemented with insertion sort.
toString
public String toString()
- Overrides:
- toString in class Object
wrap
public static TypeID wrap(byte buf[])
- Construct and initialize by shallow copy. The different notation
is meant to emphasize that a complete object is not being created
but rather an existing object is being packaged for convenience.
unwrap
public byte[] unwrap()
- Unwrap, returning the inner byte array
All Packages Class Hierarchy This Package Previous Next Index