public class HGSubgraph extends Object implements HyperNode, HGHandleHolder, HGGraphHolder
A HyperNode
that encapsulates a set of atoms from the global
HyperGraph
database. A subgraph can be thought of as a hyper-edge
in the standard set-theoretic formulation of hypergraphs.
Modifier and Type | Field and Description |
---|---|
protected HyperGraph |
graph |
protected HGHandle |
thisHandle |
Constructor and Description |
---|
HGSubgraph() |
Modifier and Type | Method and Description |
---|---|
HGHandle |
add(HGHandle atom)
Add an existing atom to this
HyperNode . |
HGHandle |
add(Object atom,
HGHandle type,
int flags)
Add to global graph and mark as member of this subgraph.
|
long |
count(HGQueryCondition condition) |
void |
define(HGHandle handle,
HGHandle type,
Object instance,
int flags)
Define in global graph and mark as member of this subgraph.
|
<T> HGSearchResult<T> |
find(HGQueryCondition condition) |
List<HGHandle> |
findAll(HGQueryCondition condition) |
<T> T |
findOne(HGQueryCondition condition) |
<T> T |
get(HGHandle handle) |
<T> List<T> |
getAll(HGQueryCondition condition) |
HGHandle |
getAtomHandle()
Return the HyperGraphDB atom handle of this object.
|
HyperGraph |
getHyperGraph() |
IncidenceSet |
getIncidenceSet(HGHandle handle)
Return incidence set where each element is a member of this
HGSubgraph . |
static HGIndex<HGPersistentHandle,HGPersistentHandle> |
getIndex(HyperGraph atGraph)
DO NOT USE: internal method, implementation dependent, may disappear at any time.
|
<T> T |
getOne(HGQueryCondition condition) |
static HGIndex<HGPersistentHandle,HGPersistentHandle> |
getReverseIndex(HyperGraph atGraph)
DO NOT USE: internal method, implementation dependent, may disappear at any time.
|
HGHandle |
getType(HGHandle handle) |
boolean |
isMember(HGHandle atom) |
boolean |
remove(HGHandle handle)
Removes an atom from this scope.
|
boolean |
removeGlobally(HGHandle handle)
Removes the atom globally from the database as well as from the nested graph.
|
boolean |
removeGlobally(HGHandle handle,
boolean keepIncidentLinks)
Removes the atom globally from the database as well as from the nested graph.
|
boolean |
replace(HGHandle handle,
Object newValue,
HGHandle newType)
Performs the replace in the global database as this only deals with
an atom's value.
|
void |
setAtomHandle(HGHandle handle)
Set the HyperGraphDB atom handle of this object - used normally only
by the
HyperGraph instance holding this atom. |
void |
setHyperGraph(HyperGraph graph)
During load time, set the
HyperGraph
instance to which this atom belongs. |
protected HyperGraph graph
protected HGHandle thisHandle
public static HGIndex<HGPersistentHandle,HGPersistentHandle> getReverseIndex(HyperGraph atGraph)
public static HGIndex<HGPersistentHandle,HGPersistentHandle> getIndex(HyperGraph atGraph)
public boolean isMember(HGHandle atom)
public HGHandle add(HGHandle atom)
Add an existing atom to this HyperNode
. The atom may be a member
multiple nodes at a time.
atom
- atom
parameter.public HGHandle add(Object atom, HGHandle type, int flags)
public long count(HGQueryCondition condition)
public void define(HGHandle handle, HGHandle type, Object instance, int flags)
public <T> HGSearchResult<T> find(HGQueryCondition condition)
public <T> T findOne(HGQueryCondition condition)
public <T> T getOne(HGQueryCondition condition)
public List<HGHandle> findAll(HGQueryCondition condition)
public <T> List<T> getAll(HGQueryCondition condition)
public IncidenceSet getIncidenceSet(HGHandle handle)
HGSubgraph
.
The atom itself whose incidence set is returned doesn't have to be a member of the
subgraph!getIncidenceSet
in interface HyperNode
public boolean removeGlobally(HGHandle handle)
handle
- The atom to remove.HyperGraph.remove
.public boolean removeGlobally(HGHandle handle, boolean keepIncidentLinks)
handle
- The atom to remove.keepIncidentLinks
- - whether to also remove links pointing to the removed
atom. This parameter applies recursively to the links removed.HyperGraph.remove
.public boolean remove(HGHandle handle)
HyperGraph
database. If you wish to delete it globally,
use HyperGraph.remove
.public boolean replace(HGHandle handle, Object newValue, HGHandle newType)
public HGHandle getAtomHandle()
HGHandleHolder
getAtomHandle
in interface HGHandleHolder
public void setAtomHandle(HGHandle handle)
HGHandleHolder
Set the HyperGraphDB atom handle of this object - used normally only
by the HyperGraph
instance holding this atom.
setAtomHandle
in interface HGHandleHolder
handle
- The atom handle.public void setHyperGraph(HyperGraph graph)
HGGraphHolder
During load time, set the HyperGraph
instance to which this atom belongs.
setHyperGraph
in interface HGGraphHolder
public HyperGraph getHyperGraph()
Copyright © 2015. All rights reserved.