public class LinkIndexer extends HGKeyIndexer<byte[]>
A LinkIndexer
indexes atoms by their target ordered set.
That is, all targets, in order, are taken to form the key of the index.
Constructor and Description |
---|
LinkIndexer() |
LinkIndexer(HGHandle type) |
LinkIndexer(String name,
HGHandle type) |
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<byte[]> |
getConverter(HyperGraph graph)
Return a
ByteArrayConverter capable of translating keys
returned by this indexer to/from a byte[] . |
byte[] |
getKey(HyperGraph graph,
Object atom)
Returns an index key for the given atom.
|
int |
hashCode()
Declared to enforce implementation.
|
public LinkIndexer()
public LinkIndexer(HGHandle type)
public boolean equals(Object other)
HGIndexer
Declared to enforce implementation.
equals
in interface HGIndexer<byte[],HGPersistentHandle>
equals
in class Object
public int hashCode()
HGIndexer
Declared to enforce implementation.
hashCode
in interface HGIndexer<byte[],HGPersistentHandle>
hashCode
in class Object
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<byte[]> 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 byte[] getKey(HyperGraph graph, Object atom)
HGKeyIndexer
Returns an index key for the given atom.
getKey
in class HGKeyIndexer<byte[]>
graph
- The current HyperGraph
instance.atom
- The atom being indexed.byte[]
,
a non-null ByteArrayConverter
must be provided by the
getConverter
method.Copyright © 2015. All rights reserved.