org.hypergraphdb.type
Class TypeUtils

java.lang.Object
  extended by org.hypergraphdb.type.TypeUtils

public final class TypeUtils
extends java.lang.Object

A set of static utility methods operating on types.

Author:
Borislav Iordanov

Nested Class Summary
static interface TypeUtils.WrappedRuntimeInstance
           
 
Constructor Summary
TypeUtils()
           
 
Method Summary
static boolean deleteInstances(HyperGraph graph, HGHandle type)
           
static boolean deleteType(HyperGraph graph, java.lang.Class<?> type, boolean recursive)
           
static boolean deleteType(HyperGraph graph, HGHandle type)
           
static boolean deleteType(HyperGraph graph, HGHandle th, boolean recursive)
           
static java.lang.String formatDimensionPath(java.lang.String[] dimPath)
           
static HGPersistentHandle getNewHandleFor(HyperGraph hg, java.lang.Object value)
           
static HGProjection getProjection(HyperGraph hg, HGAtomType type, java.lang.String[] dimPath)
           
static java.util.Map<HGPersistentHandle,java.lang.Object> getThreadHandleRefMap(HyperGraph graph)
           
static java.util.Set<HGPersistentHandle> getTransactionHandleSet(HyperGraph hg)
           
static java.util.Map<java.lang.Object,HGPersistentHandle> getTransactionObjectRefMap(HyperGraph hg)
           
static boolean isValueReleased(HyperGraph graph, HGPersistentHandle h)
           
static java.lang.Object makeValue(HyperGraph graph, HGPersistentHandle h, HGAtomType type)
           
static java.lang.String[] parseDimensionPath(java.lang.String formatted)
          Split a dimension path in dot notation to a String[].
static HGTypedValue project(HyperGraph hg, HGHandle type, java.lang.Object value, java.lang.String[] dimPath, boolean throwExceptionOnNotFound)
           
static void releaseValue(HyperGraph graph, HGPersistentHandle h)
           
static void setValueFor(HyperGraph graph, HGPersistentHandle h, java.lang.Object value)
           
static HGPersistentHandle storeValue(HyperGraph graph, java.lang.Object value, HGAtomType type)
           
static java.util.List<HGHandle> subsumesClosure(HyperGraph graph, HGHandle baseType)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TypeUtils

public TypeUtils()
Method Detail

parseDimensionPath

public static java.lang.String[] parseDimensionPath(java.lang.String formatted)

Split a dimension path in dot notation to a String[].

Parameters:
formatted - The dimension path in the format "a.b.c...d"
Returns:
The String[] {"a", "b", "c", ..., "d"}

formatDimensionPath

public static java.lang.String formatDimensionPath(java.lang.String[] dimPath)

getProjection

public static HGProjection getProjection(HyperGraph hg,
                                         HGAtomType type,
                                         java.lang.String[] dimPath)

project

public static HGTypedValue project(HyperGraph hg,
                                   HGHandle type,
                                   java.lang.Object value,
                                   java.lang.String[] dimPath,
                                   boolean throwExceptionOnNotFound)

getTransactionObjectRefMap

public static java.util.Map<java.lang.Object,HGPersistentHandle> getTransactionObjectRefMap(HyperGraph hg)

getThreadHandleRefMap

public static java.util.Map<HGPersistentHandle,java.lang.Object> getThreadHandleRefMap(HyperGraph graph)

getTransactionHandleSet

public static java.util.Set<HGPersistentHandle> getTransactionHandleSet(HyperGraph hg)

getNewHandleFor

public static HGPersistentHandle getNewHandleFor(HyperGraph hg,
                                                 java.lang.Object value)

isValueReleased

public static boolean isValueReleased(HyperGraph graph,
                                      HGPersistentHandle h)

releaseValue

public static void releaseValue(HyperGraph graph,
                                HGPersistentHandle h)

storeValue

public static HGPersistentHandle storeValue(HyperGraph graph,
                                            java.lang.Object value,
                                            HGAtomType type)

setValueFor

public static void setValueFor(HyperGraph graph,
                               HGPersistentHandle h,
                               java.lang.Object value)

makeValue

public static java.lang.Object makeValue(HyperGraph graph,
                                         HGPersistentHandle h,
                                         HGAtomType type)

subsumesClosure

public static java.util.List<HGHandle> subsumesClosure(HyperGraph graph,
                                                       HGHandle baseType)

deleteType

public static boolean deleteType(HyperGraph graph,
                                 HGHandle th,
                                 boolean recursive)

deleteType

public static boolean deleteType(HyperGraph graph,
                                 java.lang.Class<?> type,
                                 boolean recursive)

deleteType

public static boolean deleteType(HyperGraph graph,
                                 HGHandle type)

deleteInstances

public static boolean deleteInstances(HyperGraph graph,
                                      HGHandle type)