public class ByTargetIndexer extends HGKeyIndexer<HGPersistentHandle>
Represents an index by a specific target position in ordered links.
Constructor and Description |
---|
ByTargetIndexer() |
ByTargetIndexer(HGHandle type,
int target) |
ByTargetIndexer(String name,
HGHandle type,
int target) |
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<HGPersistentHandle> |
getConverter(HyperGraph graph)
Return a
ByteArrayConverter capable of translating keys
returned by this indexer to/from a byte[] . |
HGPersistentHandle |
getKey(HyperGraph graph,
Object atom)
Returns an index key for the given atom.
|
int |
getTarget() |
int |
hashCode()
Declared to enforce implementation.
|
void |
setTarget(int target) |
public ByTargetIndexer()
public ByTargetIndexer(HGHandle type, int target)
public int getTarget()
public void setTarget(int target)
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<HGPersistentHandle> 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 HGPersistentHandle getKey(HyperGraph graph, Object atom)
HGKeyIndexer
Returns an index key for the given atom.
getKey
in class HGKeyIndexer<HGPersistentHandle>
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.
equals
in interface HGIndexer<HGPersistentHandle,HGPersistentHandle>
equals
in class Object
public int hashCode()
HGIndexer
Declared to enforce implementation.
hashCode
in interface HGIndexer<HGPersistentHandle,HGPersistentHandle>
hashCode
in class Object
Copyright © 2015. All rights reserved.