public class ByPartIndexer<KeyType> extends HGKeyIndexer<KeyType>
Represents by the value of a part in a composite type.
Constructor and Description |
---|
ByPartIndexer() |
ByPartIndexer(HGHandle type,
String dimensionPath)
Convenience constructor that allows passing a dot separated dimension path
that is converted to a
String[] . |
ByPartIndexer(HGHandle type,
String[] dimensionPath) |
ByPartIndexer(String name,
HGHandle type,
String dimensionPath)
Convenience constructor that allows passing a dot separated dimension path
that is converted to a
String[] . |
ByPartIndexer(String name,
HGHandle type,
String[] dimensionPath) |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object other)
Declared to enforce implementation.
|
Comparator<byte[]> |
getComparator(HyperGraph graph)
Return a comparator used to compare key values return by this indexer.
|
ByteArrayConverter<KeyType> |
getConverter(HyperGraph graph)
Return a
ByteArrayConverter capable of translating keys
returned by this indexer to/from a byte[] . |
String[] |
getDimensionPath() |
KeyType |
getKey(HyperGraph graph,
Object atom)
Returns an index key for the given atom.
|
int |
hashCode()
Declared to enforce implementation.
|
void |
setDimensionPath(String[] dimensionPath) |
public ByPartIndexer()
public ByPartIndexer(HGHandle type, String dimensionPath)
Convenience constructor that allows passing a dot separated dimension path
that is converted to a String[]
.
type
- The type of the atoms to be indexed.dimensionPath
- The dimension path in dot format (e.g. "person.address.street")public ByPartIndexer(String name, HGHandle type, String dimensionPath)
Convenience constructor that allows passing a dot separated dimension path
that is converted to a String[]
.
name
- The name of the index.type
- The type of the atoms to be indexed.dimensionPath
- The dimension path in dot format (e.g. "person.address.street")public String[] getDimensionPath()
public void setDimensionPath(String[] dimensionPath)
public Comparator<byte[]> getComparator(HyperGraph graph)
HGIndexer
Return a comparator used to compare key values return by this indexer.
Note that the comparator's compare
method will be invoked
with byte[]
parameters. It is the comparator's responsibility
to convert them to the appropriate run-time type for performing the comparison
if need be.
The method may return null
if a default byte-by-byte comparator is to be
used.
graph
- The current HyperGraph instance.null
to use a default byte-by-byte comparison of keys.public ByteArrayConverter<KeyType> getConverter(HyperGraph graph)
HGIndexer
Return a ByteArrayConverter
capable of translating keys
returned by this indexer to/from a byte[]
.
graph
- The current HyperGraph instance.ByteArrayConverter
for type of index keys
return by this indexer or null
if keys are of type byte[]
.public KeyType getKey(HyperGraph graph, Object atom)
HGKeyIndexer
Returns an index key for the given atom.
getKey
in class HGKeyIndexer<KeyType>
graph
- The current HyperGraph
instance.atom
- The atom being indexed.byte[]
,
a non-null ByteArrayConverter
must be provided by the
getConverter
method.public boolean equals(Object other)
HGIndexer
Declared to enforce implementation.
Copyright © 2015. All rights reserved.