public class IntegerKey extends AbstractObjectKey
Modifier and Type | Field and Description |
---|---|
int |
key
The integer key
|
Modifier | Constructor and Description |
---|---|
protected |
IntegerKey(BinaryInput input,
BinarySerializator serializator)
Creates a new instance of IntegerKey loaded from binary input.
|
|
IntegerKey(java.lang.String keyString)
Creates a new instance of AbstractObjectKey given a buffered reader with the first line of the
following format: "integerKey locatorUri"
|
|
IntegerKey(java.lang.String locatorURI,
int key)
Creates a new instance of IntegerKey
|
Modifier and Type | Method and Description |
---|---|
int |
binarySerialize(BinaryOutput output,
BinarySerializator serializator)
Binary-serialize this object into the
output . |
int |
compareTo(AbstractObjectKey o)
Compare the keys according to the integer key
|
boolean |
equals(java.lang.Object obj)
Equals according to the integer key.
|
int |
getBinarySize(BinarySerializator serializator)
Returns the exact size of the binary-serialized version of this object in bytes.
|
int |
hashCode()
Return the integer key itself.
|
java.lang.String |
toString()
Returns the URI string.
|
protected void |
writeData(java.io.OutputStream stream)
Store this key's data to a text stream.
|
clone, create, getKeyStringPart, getLocatorURI, write
public IntegerKey(java.lang.String locatorURI, int key)
locatorURI
- the URI locatorkey
- the integer key of the object - it musn't be nullpublic IntegerKey(java.lang.String keyString) throws java.lang.IllegalArgumentException
keyString
- the text stream to read an object fromjava.lang.IllegalArgumentException
- if the string is not of format "integerKey locatorUri"protected IntegerKey(BinaryInput input, BinarySerializator serializator) throws java.io.IOException
input
- the input to read the IntegerKey fromserializator
- the serializator used to write objectsjava.io.IOException
- if there was an I/O error reading from the inputprotected void writeData(java.io.OutputStream stream) throws java.io.IOException
AbstractObjectKey
writeData
in class AbstractObjectKey
stream
- the stream to store this object tojava.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 withpublic int hashCode()
hashCode
in class AbstractObjectKey
public boolean equals(java.lang.Object obj)
equals
in class AbstractObjectKey
obj
- object to compare this object toobj
argument; false otherwisepublic java.lang.String toString()
AbstractObjectKey
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 objectsjava.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