public final class XStringDeserializer extends Object implements XCharIterator
| Modifier and Type | Method and Description |
|---|---|
static XStringDeserializer |
create() |
boolean |
equals(Object object)
Test if this
XStringDeserializer is equal to another XStringDeserializer. |
int |
getTo(byte[] val,
int offset) |
int |
getTo(IOBuffer val,
int offset) |
int |
getTo(long addr,
int offset) |
int |
getTo(XString val) |
int |
hashCode()
Return the current hash code of this
XStringDeserializer. |
boolean |
hasNext()
Returns true if the iteration has more elements.
|
XStringDeserializer |
init(long addr,
int offset,
int len) |
boolean |
isInitialized() |
XCharIterator |
iterator() |
char |
next()
Returns the next element in the iteration.
|
void |
remove()
Removes from the underlying collection the last element returned by the
iterator (optional operation).
|
int |
serializedLength() |
String |
toASCIIString() |
XCharIterator |
toFirst()
Resets the iterator to the beginning.
|
String |
toUTF8String() |
public static final XStringDeserializer create()
public final boolean hasNext()
XCharIteratorhasNext in interface XCharIteratorpublic final char next()
XCharIteratornext in interface XCharIteratorpublic final void remove()
XCharIteratorremove in interface XCharIteratorpublic XCharIterator toFirst()
XCharIteratortoFirst in interface XCharIteratorpublic final XStringDeserializer init(long addr, int offset, int len)
public final boolean isInitialized()
public final int serializedLength()
public final int getTo(byte[] val,
int offset)
public final int getTo(long addr,
int offset)
public final int getTo(IOBuffer val, int offset)
public final int getTo(XString val)
public final String toASCIIString()
public final String toUTF8String()
public final XCharIterator iterator()
public final boolean equals(Object object)
XStringDeserializer is equal to another XStringDeserializer.
Two XStringDeserializers that are initialized are equal if their backing byte
representations are the equivalent.equals in class Objectobject - The object against which to compareXStringDeserializer equals the provided objectpublic final int hashCode()
XStringDeserializer.
The hash code of an XStringDeserializer is based on the backing byte
representation. The hashcode of a XStringDeserializer will change if the
underlying bytes are modified.
Because XStringDeserialier hash codes are content-dependent and are
mutable, it is inadvisable XStringDeserializers as keys in hash maps or
similar data structures unless it is known that their contents will not change.
XStringDeserializer Hash Algorithm (same as XString Hash Algorithm0
The hashing algorithm for an XStringDeserializer is as follows:
if (!isInitialized()) throw new IllegalStateException("not initialized");
if (_len == 0) {
return 0;
}
int h = 1;
for (int i = 0; i < _len; i++) {
h = 31 * h + IOBuffer.getByte(_addr, _offset + i);
}
return h;
hashCode in class ObjectXStringDeserializerCopyright © 2019 N5 Technologies, Inc. All Rights Reserved.