public class StringType extends PrimitiveTypeBase<String>
The implementation of the primitive String
type.
This implementation should be used only for relatively small strings, things like
names or titles, since they are indexed and reference counted for lookup.
If you want to store larger text data, including big documents, use the
TextType
instead.
A java.lang.String
object is translated to a byte [] as
follows:
null
, empty or it has actual content: 0 means null, 1 means empty
and 2 means we have something. In the future this might be extended to support
various encodings.Modifier and Type | Class and Description |
---|---|
static class |
StringType.CaseInsensitiveStringComparator |
static class |
StringType.StringComparator |
Modifier and Type | Field and Description |
---|---|
static String |
INDEX_NAME |
dataOffset, graph, valueIndex
Constructor and Description |
---|
StringType() |
Modifier and Type | Method and Description |
---|---|
Comparator<byte[]> |
getComparator()
Return a
java.util.Comparator instance that provides
an order relation of the values of the primitive type. |
protected String |
getIndexName()
Return the name of the DB index to create for the primitive values.
|
boolean |
isCaseSensitive() |
protected String |
readBytes(byte[] data,
int offset) |
void |
setCaseSensitive(boolean caseSensitive) |
protected byte[] |
writeBytes(String value) |
compare, find, findGT, findGTE, findLT, findLTE, fromByteArray, getIndex, getRefCount, getRefCountFor, make, putRefCount, release, setHyperGraph, store, storeImpl, subsumes, toByteArray
public static final String INDEX_NAME
public Comparator<byte[]> getComparator()
HGPrimitiveType
java.util.Comparator
instance that provides
an order relation of the values of the primitive type. An implementation
is allowed to return null
in which case it is assumed
that the type does not offer an ordering relation. However, if a
non-null value is returned, it is must be of a publicly available
and default constructible class.protected String getIndexName()
PrimitiveTypeBase
Return the name of the DB index to create for the primitive values.
getIndexName
in class PrimitiveTypeBase<String>
protected byte[] writeBytes(String value)
writeBytes
in class PrimitiveTypeBase<String>
protected String readBytes(byte[] data, int offset)
readBytes
in class PrimitiveTypeBase<String>
public boolean isCaseSensitive()
public void setCaseSensitive(boolean caseSensitive)
Copyright © 2015. All rights reserved.