public class EnumType extends HGAtomTypeBase implements HGPrimitiveType
| Modifier and Type | Class and Description |
|---|---|
static class |
EnumType.ENUM_COMPARATOR_IMPL |
| Modifier and Type | Field and Description |
|---|---|
static EnumType.ENUM_COMPARATOR_IMPL |
ENUM_COMPARATOR |
graph| Constructor and Description |
|---|
EnumType() |
EnumType(Class<Enum<?>> enumType) |
| Modifier and Type | Method and Description |
|---|---|
Object |
fromByteArray(byte[] byteArray,
int offset,
int length) |
Comparator<byte[]> |
getComparator()
Return a
java.util.Comparator instance that provides
an order relation of the values of the primitive type. |
Class<?> |
getEnumType() |
Object |
make(HGPersistentHandle handle,
LazyRef<HGHandle[]> targetSet,
IncidenceSetRef incidenceSet)
Construct a new run-time instance of a hypergraph atom.
|
void |
release(HGPersistentHandle handle)
Release a hypergraph value instance from the persistent store.
|
void |
setEnumType(Class<Enum<?>> enumType) |
HGPersistentHandle |
store(Object instance)
Store a run-time instance of a hypergraph atom into the hypergraph
HGStore
as a new atom. |
byte[] |
toByteArray(Object object) |
getHyperGraph, setHyperGraph, subsumesclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitsubsumessetHyperGraphpublic static final EnumType.ENUM_COMPARATOR_IMPL ENUM_COMPARATOR
public final Class<?> getEnumType()
public Object make(HGPersistentHandle handle, LazyRef<HGHandle[]> targetSet, IncidenceSetRef incidenceSet)
HGAtomTypeConstruct a new run-time instance of a hypergraph atom. A plain node must
be constructed whenever the targetSet parameter is null or of
length 0. Otherwise, a HGLink instance must be constructed.
It is not required that all atom types be able to construct both plain (node)
atoms and HGLinks. It is up to an HGAtomType implementation
to support either or both. When a HGLink counterpart is not available
for a particular run-time type, an implementation may choose to create an instance
of the default link value holder implementation HGValuedLink, provided
by HyperGraph.
make in interface HGAtomTypehandle - The HGPersistentHandle of the atom value.targetSet - When the atom is a link, this parameter holds the target set of
the link. When the atom is a node, the parameter is an array of 0 length.incidenceSet - A lazy reference to the set of links pointing to this atom. This is
null if we are constructing an internal/nested value of some complex type.null.
In case the handle points to an invalid instance (inexisting or with
a erronous layout), the method should throw a HGException.public HGPersistentHandle store(Object instance)
HGAtomTypeStore a run-time instance of a hypergraph atom into the hypergraph HGStore
as a new atom.
store in interface HGAtomTypeinstance - The atom instance.public void release(HGPersistentHandle handle)
HGAtomTypeRelease a hypergraph value instance from the persistent store.
This method should be called when a HGPersistentHandle
returned from the store is no longer in use.
release in interface HGAtomTypehandle - The persistent handle of the value to release.public Object fromByteArray(byte[] byteArray, int offset, int length)
fromByteArray in interface ByteArrayConverterpublic byte[] toByteArray(Object object)
toByteArray in interface ByteArrayConverterpublic Comparator<byte[]> getComparator()
HGPrimitiveTypejava.util.Comparator instance that provides
an order relation of the values of the primitive type. An implementation
is allowed to return null in which case it is assumed
that the type does not offer an ordering relation. However, if a
non-null value is returned, it is must be of a publicly available
and default constructible class.getComparator in interface HGPrimitiveTypeCopyright © 2015. All rights reserved.