|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectmessif.objects.keys.AbstractObjectKey
public class AbstractObjectKey
This class encapsulates the standard key used by the AbstractObject - the URI locator. It is also an ancestor of all key classes to be used in the Abstact object.
Constructor Summary | |
---|---|
protected |
AbstractObjectKey(BinaryInput input,
BinarySerializator serializator)
Creates a new instance of AbstractObjectKey loaded from binary input. |
|
AbstractObjectKey(java.lang.String locatorURI)
Creates a new instance of AbstractObjectKey given the locator URI. |
Method Summary | ||
---|---|---|
int |
binarySerialize(BinaryOutput output,
BinarySerializator serializator)
Binary-serialize this object into the output . |
|
int |
compareTo(AbstractObjectKey o)
Compare the keys according to their locators. |
|
static
|
create(java.lang.Class<? extends T> keyClass,
java.lang.String keyData)
Factory method for creating object key instances of arbitrary class. |
|
boolean |
equals(java.lang.Object obj)
Returns whether this key is equal to the obj . |
|
int |
getBinarySize(BinarySerializator serializator)
Returns the exact size of the binary-serialized version of this object in bytes. |
|
java.lang.String |
getLocatorURI()
Returns the URI from this key as a string. |
|
int |
hashCode()
Return the hashCode of the locator URI or 0, if it is null. |
|
java.lang.String |
toString()
Returns the URI string. |
|
void |
write(java.io.OutputStream stream)
Writes this object key into the output text stream. |
|
protected void |
writeData(java.io.OutputStream stream)
Store this key's data to a text stream. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public AbstractObjectKey(java.lang.String locatorURI)
locatorURI
- the URI locatorprotected AbstractObjectKey(BinaryInput input, BinarySerializator serializator) throws java.io.IOException
input
- the input to read the AbstractObjectKey fromserializator
- the serializator used to write objects
java.io.IOException
- if there was an I/O error reading from the inputMethod Detail |
---|
public static <T extends AbstractObjectKey> T create(java.lang.Class<? extends T> keyClass, java.lang.String keyData)
String
argument.
T
- the class of created the object keykeyClass
- the class of created the object keykeyData
- the data from which to create the key
public java.lang.String getLocatorURI()
public final void write(java.io.OutputStream stream) throws java.io.IOException
#objectKey keyClass key value
stream
- the stream to write the key to
java.io.IOException
- if any problem occures during comment writingprotected void writeData(java.io.OutputStream stream) throws java.io.IOException
stream
- the stream to store this object to
java.io.IOException
- if there was an error while writing to streampublic int compareTo(AbstractObjectKey o)
compareTo
in interface java.lang.Comparable<AbstractObjectKey>
o
- the key to compare this key with
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
obj
.
It is only and only if the obj
is descendant of
AbstractObjectKey
and has an equal locator URI.
equals
in class java.lang.Object
obj
- the object to compare this object to
obj
argument; false otherwisepublic java.lang.String toString()
toString
in class java.lang.Object
public int binarySerialize(BinaryOutput output, BinarySerializator serializator) throws java.io.IOException
output
.
binarySerialize
in interface BinarySerializable
output
- the output that this object is binary-serialized intoserializator
- the serializator used to write objects
java.io.IOException
- if there was an I/O error during serializationpublic int getBinarySize(BinarySerializator serializator)
getBinarySize
in interface BinarySerializable
serializator
- the serializator used to write objects
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |