org.hypergraphdb.type.javaprimitive
Class EnumType

java.lang.Object
  extended by org.hypergraphdb.type.HGAtomTypeBase
      extended by org.hypergraphdb.type.javaprimitive.EnumType
All Implemented Interfaces:
HGGraphHolder, HGAtomType

public class EnumType
extends HGAtomTypeBase


Constructor Summary
EnumType()
           
EnumType(java.lang.Class<java.lang.Enum> enumType)
           
 
Method Summary
 java.lang.Class<?> getEnumType()
           
 java.lang.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(java.lang.Class<java.lang.Enum> enumType)
           
 HGPersistentHandle store(java.lang.Object instance)
          Store a run-time instance of a hypergraph atom into the hypergraph HGStore as a new atom.
 
Methods inherited from class org.hypergraphdb.type.HGAtomTypeBase
setHyperGraph, subsumes
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EnumType

public EnumType()

EnumType

public EnumType(java.lang.Class<java.lang.Enum> enumType)
Method Detail

getEnumType

public final java.lang.Class<?> getEnumType()

setEnumType

public final void setEnumType(java.lang.Class<java.lang.Enum> enumType)

make

public java.lang.Object make(HGPersistentHandle handle,
                             LazyRef<HGHandle[]> targetSet,
                             IncidenceSetRef incidenceSet)
Description copied from interface: HGAtomType

Construct 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.

Parameters:
handle - 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 - TODO
Returns:
The run-time atom instance. The return value should never be null. In case the handle points to an invalid instance (inexisting or with a erronous layout), the method should throw a HGException.

store

public HGPersistentHandle store(java.lang.Object instance)
Description copied from interface: HGAtomType

Store a run-time instance of a hypergraph atom into the hypergraph HGStore as a new atom.

Parameters:
instance - The atom instance.
Returns:
The persistent handle of the stored value.

release

public void release(HGPersistentHandle handle)
Description copied from interface: HGAtomType

Release 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.

Parameters:
handle - The persistent handle of the value to release.