public class TargetToTargetIndexer extends HGValueIndexer<HGHandle,HGHandle>
A HGValueIndexer for HyperGraph links where the key in the index is
one of the targets within a link and the value is another one of the targets.
| Constructor and Description |
|---|
TargetToTargetIndexer() |
TargetToTargetIndexer(HGHandle type,
int fromTarget,
int toTarget) |
TargetToTargetIndexer(String name,
HGHandle type,
int fromTarget,
int toTarget) |
| 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<HGHandle> |
getConverter(HyperGraph graph)
Return a
ByteArrayConverter capable of translating keys
returned by this indexer to/from a byte[]. |
int |
getFromTarget() |
HGHandle |
getKey(HyperGraph graph,
Object atom)
Returns an index key for the given atom.
|
int |
getToTarget() |
HGHandle |
getValue(HyperGraph graph,
Object atom)
Return the value of an index entry based on the passed in atom.
|
ByteArrayConverter<HGHandle> |
getValueConverter(HyperGraph graph)
Return a
ByteArrayConverter capable of converting index
entry values to/from byte arrays. |
int |
hashCode()
Declared to enforce implementation.
|
void |
setFromTarget(int fromTarget) |
void |
setToTarget(int toTarget) |
public TargetToTargetIndexer()
public TargetToTargetIndexer(HGHandle type, int fromTarget, int toTarget)
public int getFromTarget()
public void setFromTarget(int fromTarget)
public int getToTarget()
public void setToTarget(int toTarget)
public HGHandle getKey(HyperGraph graph, Object atom)
HGValueIndexerReturns an index key for the given atom.
getKey in class HGValueIndexer<HGHandle,HGHandle>graph - The current HyperGraph instance.atom - The atom being indexed.byte[],
a non-null ByteArrayConverter must be provided by the
getConverter method.public HGHandle getValue(HyperGraph graph, Object atom)
HGValueIndexerReturn the value of an index entry based on the passed in atom.
getValue in class HGValueIndexer<HGHandle,HGHandle>public ByteArrayConverter<HGHandle> getValueConverter(HyperGraph graph)
HGValueIndexer
Return a ByteArrayConverter capable of converting index
entry values to/from byte arrays.
getValueConverter in class HGValueIndexer<HGHandle,HGHandle>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<HGHandle> getConverter(HyperGraph graph)
HGIndexerReturn 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 int hashCode()
HGIndexerDeclared to enforce implementation.
Copyright © 2015. All rights reserved.