public final class SystemID extends java.lang.Object implements ISerializable
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
ABBREVIATION
The abbreviation used for this class during serialization.
|
static int |
LENGTH
The length of the byte array representation of the system id.
|
static SystemID |
SYSTEM
The id of the local system.
|
Constructor and Description |
---|
SystemID()
Creates a new uninitialized system id.
|
SystemID(byte[] id)
Creates a system id from a byte sequence.
|
SystemID(long id)
Creates a system id with the given id.
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(SystemID id)
Compares this system id with the specified system id and returns
0 if this id equals the system id, returns 1 if this id is larger
than the system id and -1 if this id is smaller than the system id.
|
boolean |
equals(java.lang.Object object)
Determines whether this object equals the given object.
|
byte[] |
getBytes()
Returns a compact byte representation of the system id.
|
int |
hashCode()
Returns the hash code of this system id.
|
void |
readObject(IObjectInput input)
Reads the SystemID from a stream.
|
static void |
setBytes(byte[] system)
Sets the local system id.
|
static byte[] |
toBytes(long value)
Casts a long value to a byte array that
has the length of the id array.
|
java.lang.String |
toString()
Returns a string representation.
|
static SystemID |
valueOf(byte[] bytes)
Converts a compact byte representation of a system id
into a system id object.
|
void |
writeObject(IObjectOutput output)
Writes the SystemID to the given stream.
|
public static final java.lang.String ABBREVIATION
public static final SystemID SYSTEM
public static final int LENGTH
public SystemID()
public SystemID(long id)
id
- The id of the system id.public SystemID(byte[] id)
id
- The byte sequence.public static SystemID valueOf(byte[] bytes) throws java.lang.NumberFormatException
bytes
- The bytes that represent a system id.java.lang.NumberFormatException
- Thrown if the bytes do not
represent a valid system id.public void readObject(IObjectInput input) throws java.io.IOException
readObject
in interface ISerializable
input
- The stream to read from.java.io.IOException
- Thrown if reading caused this exception.public void writeObject(IObjectOutput output) throws java.io.IOException
writeObject
in interface ISerializable
output
- The stream to write to.java.io.IOException
- If writing to the stream caused an exception.public boolean equals(java.lang.Object object)
equals
in class java.lang.Object
object
- The object used for the comparison.public int compareTo(SystemID id)
id
- The system id to compare this id to.public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public byte[] getBytes()
public static final byte[] toBytes(long value)
value
- The value to cast.public static final void setBytes(byte[] system)
system
- The byte representation of the local system id.