public class StringDataType extends BasicDataType<java.lang.String>
| Modifier and Type | Field and Description |
|---|---|
static StringDataType |
INSTANCE |
| Constructor and Description |
|---|
StringDataType() |
| Modifier and Type | Method and Description |
|---|---|
int |
binarySearch(java.lang.String key,
java.lang.Object storageObj,
int size,
int initialGuess)
Perform binary search for the key within the storage
|
int |
compare(java.lang.String a,
java.lang.String b)
Compare two keys.
|
java.lang.String[] |
createStorage(int size)
Create storage object of array type to hold values
|
int |
getMemory(java.lang.String obj)
Calculates the amount of used memory in bytes.
|
java.lang.String |
read(java.nio.ByteBuffer buff)
Read an object.
|
void |
write(WriteBuffer buff,
java.lang.String s)
Write an object.
|
cast, equals, hashCode, isMemoryEstimationAllowed, read, writepublic static final StringDataType INSTANCE
public java.lang.String[] createStorage(int size)
DataTypesize - number of values to holdpublic int compare(java.lang.String a,
java.lang.String b)
DataTypecompare in interface java.util.Comparator<java.lang.String>compare in interface DataType<java.lang.String>compare in class BasicDataType<java.lang.String>a - the first keyb - the second keypublic int binarySearch(java.lang.String key,
java.lang.Object storageObj,
int size,
int initialGuess)
DataTypebinarySearch in interface DataType<java.lang.String>binarySearch in class BasicDataType<java.lang.String>key - to search forstorageObj - to search within (an array of type T)size - number of data items in the storageinitialGuess - for key positionpublic int getMemory(java.lang.String obj)
DataTypegetMemory in interface DataType<java.lang.String>getMemory in class BasicDataType<java.lang.String>obj - the objectpublic java.lang.String read(java.nio.ByteBuffer buff)
DataTyperead in interface DataType<java.lang.String>read in class BasicDataType<java.lang.String>buff - the source bufferpublic void write(WriteBuffer buff, java.lang.String s)
DataTypewrite in interface DataType<java.lang.String>write in class BasicDataType<java.lang.String>buff - the target buffers - the value