|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectmessif.objects.keys.AbstractObjectKey
messif.objects.keys.LongKey
public class LongKey
The object key that contains a long value and a locator URI.
Field Summary | |
---|---|
long |
key
The long key |
Constructor Summary | |
---|---|
protected |
LongKey(BinaryInput input,
BinarySerializator serializator)
Creates a new instance of LongKey loaded from binary input. |
|
LongKey(java.lang.String keyString)
Creates a new instance of AbstractObjectKey given a buffered reader with the first line of the following format: "longKey locatorUri" |
|
LongKey(java.lang.String locatorURI,
boolean hashURI,
long maxValue)
Creates a new instance of LongKey given only the locatorURI - implicitly create the key as the (locatorURI.hashCode() + Integer.MAX_VALUE) modulo maxKey . |
|
LongKey(java.lang.String locatorURI,
long key)
Creates a new instance of LongKey |
Method Summary | |
---|---|
int |
binarySerialize(BinaryOutput output,
BinarySerializator serializator)
Binary-serialize this object into the output . |
int |
compareTo(AbstractObjectKey o)
Compare the keys according to the long key |
boolean |
equals(java.lang.Object obj)
Equals according to the long key. |
int |
getBinarySize(BinarySerializator serializator)
Returns the exact size of the binary-serialized version of this object in bytes. |
int |
hashCode()
Return the long key converted to int. |
java.lang.String |
toString()
Return the URI string. |
protected void |
writeData(java.io.OutputStream stream)
Store this key's data to a text stream. |
Methods inherited from class messif.objects.keys.AbstractObjectKey |
---|
create, getLocatorURI, write |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public final long key
Constructor Detail |
---|
public LongKey(java.lang.String locatorURI, long key)
locatorURI
- the URI locatorkey
- the long key of the object - it musn't be nullpublic LongKey(java.lang.String locatorURI, boolean hashURI, long maxValue) throws java.lang.IllegalArgumentException
(locatorURI.hashCode() + Integer.MAX_VALUE) modulo maxKey
.
locatorURI
- the URI locatorhashURI
- if true then the key is created as hashCode of the locator; it set to 0, otherwisemaxValue
- the maximal value the key can have (incremented by 1)
java.lang.IllegalArgumentException
- if the locatorURI is nullpublic LongKey(java.lang.String keyString) throws java.lang.IllegalArgumentException
keyString
- the text stream to read an object from
java.lang.IllegalArgumentException
- if the string is not of format "longKey locatorUri"protected LongKey(BinaryInput input, BinarySerializator serializator) throws java.io.IOException
input
- the input to read the LongKey fromserializator
- the serializator used to write objects
java.io.IOException
- if there was an I/O error reading from the inputMethod Detail |
---|
protected void writeData(java.io.OutputStream stream) throws java.io.IOException
AbstractObjectKey
writeData
in class AbstractObjectKey
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>
compareTo
in class AbstractObjectKey
o
- the key to compare this key with
public int hashCode()
hashCode
in class AbstractObjectKey
public boolean equals(java.lang.Object obj)
equals
in class AbstractObjectKey
obj
- object to compare this object to
obj
argument; false otherwisepublic java.lang.String toString()
toString
in class AbstractObjectKey
public int binarySerialize(BinaryOutput output, BinarySerializator serializator) throws java.io.IOException
output
.
binarySerialize
in interface BinarySerializable
binarySerialize
in class AbstractObjectKey
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
getBinarySize
in class AbstractObjectKey
serializator
- the serializator used to write objects
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |