anthill.antnet
Class AntIdImpl
java.lang.Object
|
+--anthill.antnet.AntIdImpl
- All Implemented Interfaces:
- AntId
- public class AntIdImpl
- extends java.lang.Object
- implements AntId
Class AntIdImpl
is the implementation of AntId
to be used in
a deployment environment. These pseudo-unique identifiers are constituted by a sequence
of bytes generated randomly through java.security.SecureRandom
. Two
identifiers are equal if they contains the same sequence of bytes.
- Version:
- $Revision$
- Author:
- Alberto Montresor
Field Summary |
static int |
SIZE
Number of random bytes in the identifier |
Constructor Summary |
AntIdImpl()
Builds a new identifier, by generating a random sequence of
SIZE bytes. |
Method Summary |
boolean |
equals(java.lang.Object obj)
Check whether this AntIdImpl is equal to the specified object. |
int |
hashCode()
Returns a hash code value for the object. |
java.lang.String |
toString()
Returns a string representation of the object. |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
SIZE
public static int SIZE
- Number of random bytes in the identifier
AntIdImpl
public AntIdImpl()
- Builds a new identifier, by generating a random sequence of
SIZE
bytes.
equals
public boolean equals(java.lang.Object obj)
- Check whether this
AntIdImpl
is equal to the specified object.
- Overrides:
equals
in class java.lang.Object
hashCode
public int hashCode()
- Returns a hash code value for the object.
- Overrides:
hashCode
in class java.lang.Object
toString
public java.lang.String toString()
- Returns a string representation of the object.
- Overrides:
toString
in class java.lang.Object