|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectmessif.objects.UniqueID
messif.objects.AbstractObject
messif.objects.LocalAbstractObject
messif.objects.impl.ObjectString
public abstract class ObjectString
This object uses String
as its data content.
No implementation of distance function is provided - see ObjectStringEditDist
.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class messif.objects.LocalAbstractObject |
---|
LocalAbstractObject.DataEqualObject |
Field Summary | |
---|---|
protected java.lang.String |
text
Data string |
Fields inherited from class messif.objects.LocalAbstractObject |
---|
counterDistanceComputations, counterLowerBoundDistanceComputations, counterUpperBoundDistanceComputations, MAX_DISTANCE, MIN_DISTANCE, suppData, UNKNOWN_DISTANCE |
Constructor Summary | |
---|---|
|
ObjectString()
Creates a new instance of ObjectString with randomly generated string content. |
protected |
ObjectString(BinaryInput input,
BinarySerializator serializator)
Creates a new instance of ObjectString loaded from binary input buffer. |
|
ObjectString(java.io.BufferedReader stream)
Creates a new instance of ObjectString from text stream. |
|
ObjectString(int minLength,
int maxLength)
Creates a new instance of ObjectString with randomly generated string content. |
|
ObjectString(java.lang.String text)
Creates a new instance of ObjectString. |
Method Summary | |
---|---|
int |
binarySerialize(BinaryOutput output,
BinarySerializator serializator)
Binary-serialize this object into the output . |
LocalAbstractObject |
cloneRandomlyModify(java.lang.Object... args)
Creates and returns a randomly modified copy of this string. |
boolean |
dataEquals(java.lang.Object obj)
Indicates whether some other object has the same data as this one. |
int |
dataHashCode()
Returns a hash code value for the data of this object. |
static java.lang.String |
generateRandom(int minLength,
int maxLength)
Generate a random text. |
int |
getBinarySize(BinarySerializator serializator)
Returns the exact size of the binary-serialized version of this object in bytes. |
int |
getSize()
Returns the size of this object in bytes. |
java.lang.String |
getStringData()
Returns the string that represents the contents of this object. |
int |
getStringLength()
Returns the length of the content string. |
java.lang.String |
toString()
Converts this object to a string representation. |
void |
writeData(java.io.OutputStream stream)
Store this object's data to a text stream. |
Methods inherited from class messif.objects.AbstractObject |
---|
clone, getLocatorURI, getNoDataObject, getObjectID, getObjectKey, setObjectKey |
Methods inherited from class messif.objects.UniqueID |
---|
compareTo, equals, hashCode |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected java.lang.String text
Constructor Detail |
---|
public ObjectString(java.lang.String text)
text
- the string content of the new objectpublic ObjectString()
public ObjectString(int minLength, int maxLength)
minLength
characters
and at most maxLength
characters.
minLength
- minimal length of the randomly generated string contentmaxLength
- maximal length of the randomly generated string contentpublic ObjectString(java.io.BufferedReader stream) throws java.io.EOFException, java.io.IOException
stream
- the stream from which to read lines of text
java.io.EOFException
- if the end-of-file of the given stream is reached
java.io.IOException
- if there was an I/O error during reading from the streamprotected ObjectString(BinaryInput input, BinarySerializator serializator) throws java.io.IOException
input
- the buffer to read the ObjectString fromserializator
- the serializator used to write objects
java.io.IOException
- if there was an I/O error reading from the bufferMethod Detail |
---|
public static java.lang.String generateRandom(int minLength, int maxLength)
minLength
characters
and at most maxLength
characters.
minLength
- minimal length of the randomly generated textmaxLength
- maximal length of the randomly generated text
public void writeData(java.io.OutputStream stream) throws java.io.IOException
LocalAbstractObject
writeData
in class LocalAbstractObject
stream
- the stream to store this object to
java.io.IOException
- if there was an error while writing to streampublic boolean dataEquals(java.lang.Object obj)
LocalAbstractObject
dataEquals
in class LocalAbstractObject
obj
- the reference object with which to compare.
true
if this object is the same as the obj
argument; false
otherwise.public int dataHashCode()
LocalAbstractObject
dataHashCode
in class LocalAbstractObject
public java.lang.String getStringData()
public int getStringLength()
public int getSize()
LocalAbstractObject
getSize
in class LocalAbstractObject
public LocalAbstractObject cloneRandomlyModify(java.lang.Object... args) throws java.lang.CloneNotSupportedException
cloneRandomlyModify
in class LocalAbstractObject
args
- expected size of the args array is 1: ObjectString containing all possible chars
java.lang.CloneNotSupportedException
- if the object's class does not support clonning or there was an errorpublic java.lang.String toString()
toString
in class AbstractObject
public int binarySerialize(BinaryOutput output, BinarySerializator serializator) throws java.io.IOException
LocalAbstractObject
output
.
binarySerialize
in interface BinarySerializable
binarySerialize
in class LocalAbstractObject
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)
LocalAbstractObject
getBinarySize
in interface BinarySerializable
getBinarySize
in class LocalAbstractObject
serializator
- the serializator used to write objects
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |