public class IntHandleFactory extends Object implements HGHandleFactory
Produces integer valued persistent handles. This leads to more compact storage and an overall performance improvement due to less read/write time as well as less time spent comparing and sorting handles. As with other handle factories based on a local seed, handles generated by this factory will not be universal and will certainly result in conflicts in a distributed environment.
| Constructor and Description |
|---|
IntHandleFactory() |
| Modifier and Type | Method and Description |
|---|---|
HGPersistentHandle |
anyHandle()
The
anyHandle is a persistent handle constant that represents
a "don't care" handle during querying and comparison operations. |
int |
getNext() |
HGPersistentHandle |
linkTypeHandle() |
HGPersistentHandle |
makeHandle()
Construct and return a new, unique persistent handle.
|
HGPersistentHandle |
makeHandle(byte[] buffer)
Construct a persistent handle from its byte array representation.
|
HGPersistentHandle |
makeHandle(byte[] buffer,
int offset)
Construct a persistent handle from its byte array representation where the byte array
is part of a larger buffer and located at a particular offset.
|
HGPersistentHandle |
makeHandle(String handleAsString)
Construct a persistent handle from its string representation.
|
HGPersistentHandle |
nullHandle()
Return the representation of a null persistent handle.
|
HGPersistentHandle |
nullTypeHandle() |
void |
setNext(int next) |
HGPersistentHandle |
subsumesTypeHandle() |
HGPersistentHandle |
topTypeHandle() |
public int getNext()
public void setNext(int next)
public HGPersistentHandle anyHandle()
HGHandleFactory
The anyHandle is a persistent handle constant that represents
a "don't care" handle during querying and comparison operations. It can be used, for
instance, when defining an OrdererLinkCondition in a query.
For efficiency reasons, the equals method of the various implementations of
the HGHandle interface ignore this constant, even though it would be
more consistent to for anyHandle.equals(x) and x.equals(anyHandle)
to always return true.
anyHandle in interface HGHandleFactorypublic HGPersistentHandle makeHandle()
HGHandleFactoryConstruct and return a new, unique persistent handle. The handle is permanently unique. It can be persistent (serialized) and restored without ever conflicting with another handle.
makeHandle in interface HGHandleFactorypublic HGPersistentHandle makeHandle(String handleAsString)
HGHandleFactoryConstruct a persistent handle from its string representation.
makeHandle in interface HGHandleFactorypublic HGPersistentHandle makeHandle(byte[] buffer)
HGHandleFactoryConstruct a persistent handle from its byte array representation.
makeHandle in interface HGHandleFactorybuffer - The byte array holding the handle value.public HGPersistentHandle makeHandle(byte[] buffer, int offset)
HGHandleFactoryConstruct a persistent handle from its byte array representation where the byte array is part of a larger buffer and located at a particular offset.
makeHandle in interface HGHandleFactorybuffer - The byte array holding the handle value.offset - The offset within buffer where the handle value starts.public HGPersistentHandle nullHandle()
HGHandleFactoryReturn the representation of a null persistent handle. A null
handle is a single instance and therefore can be compared for equality by
doing direct Java object reference comparison. A null handle can be
recorded in storage as any other persistent handle - it refers to no
value. Not that while HyperGraph's type system does not provide
for null atom values or value projections, null references
to values are permitted and supported through the null
HGPersistentHandle
nullHandle in interface HGHandleFactorypublic HGPersistentHandle topTypeHandle()
topTypeHandle in interface HGHandleFactorypublic HGPersistentHandle nullTypeHandle()
nullTypeHandle in interface HGHandleFactorypublic HGPersistentHandle linkTypeHandle()
linkTypeHandle in interface HGHandleFactorypublic HGPersistentHandle subsumesTypeHandle()
subsumesTypeHandle in interface HGHandleFactoryCopyright © 2015. All rights reserved.