|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.upc.dama.dex.core.Graph
edu.upc.dama.dex.core.RGraph
public final class RGraph
Temporary Graphs.
It manages temporary Graphs. Queries usually build
Graphs as a result, although it is not mandatory;
these Graphs are RGraphs.
As DbGraph, RGraphs' memory management is done
automatically by the GraphPool, but they are different from
DbGraph because they are not persistent, that is they are
temporary. They will be automatically destroyed when the GraphPool
is finished or by means of the RGraph.close() method.
Graphs cannot be instantiated directly, they are obteined
from the parent GraphPool through Session.newGraph() method.
Another property of RGraphs is the node inheritance. Nodes
from a Graph (aka the parent Graph) can be inherited
into another RGraph. All the attributes of that node and their
values will be inherited too. Moreover, if the type of the node do
not exists in the RGraph, then the corresponding type will
be automatically registered.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class edu.upc.dama.dex.core.Graph |
|---|
Graph.AttributeData, Graph.AttributeStats, Graph.RankData, Graph.TypeData |
| Field Summary |
|---|
| Fields inherited from class edu.upc.dama.dex.core.Graph |
|---|
ATTR_KIND_BASIC, ATTR_KIND_INDEXED, ATTR_KIND_UNIQUE, EDGES_BOTH, EDGES_IN, EDGES_OUT, numEdges, numNodes, OPERATION_BETWEEN, OPERATION_EQ, OPERATION_ERE, OPERATION_GE, OPERATION_GT, OPERATION_ILIKE, OPERATION_LE, OPERATION_LIKE, OPERATION_LT, OPERATION_NE, ORDER_ASCENDENT, ORDER_DESCENDENT |
| Fields inherited from interface edu.upc.dama.dex.core.Identifiers |
|---|
DBGRAPH_ID, GLOBAL_TYPE, INVALID_ATTRIBUTE, INVALID_EDGE, INVALID_NODE, INVALID_OID, INVALID_TYPE |
| Method Summary | |
|---|---|
long |
addNode(Graph parentGraph,
long parentNode)
Adds (inherits) a node from a Graph. |
long |
addNode(Graph parentGraph,
long parentNode,
boolean exception)
Adds (inherits) a node from a Graph. |
void |
close()
Closes the instance and frees resources. |
long |
getParent(long oid)
Gets the parent Graph node identifier
of the given RGraph node identifier. |
boolean |
isOpen()
Gets if the RGraph is open. |
long |
lookupNode(long parentNode)
Gets the RGraph node identifier
of the given parent Graph node identifier. |
void |
save(java.io.File file)
Saves the RGraph to the given file. |
void |
save(java.lang.String filename)
Saves the RGraph to the given file. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public void close()
It is important to close RGraphs as soon as possible
to free its memory resources.
close in interface java.io.Closeableclose in class Graphpublic boolean isOpen()
RGraph is open.
Only opened RGraphs can execute methods, otherwise
they will fail.
isOpen in class Graphtrue if the RGraph is open,
false otherwise.
public void save(java.io.File file)
throws java.io.FileNotFoundException
RGraph to the given file.
file - File.
java.io.FileNotFoundException - If file
is not a valid file.GraphPool.loadGraph(File)
public void save(java.lang.String filename)
throws java.io.FileNotFoundException
RGraph to the given file.
filename - Name of the file.
java.io.FileNotFoundException - If filename
is not a valid file name.GraphPool.loadGraph(File)public long getParent(long oid)
Graph node identifier
of the given RGraph node identifier.
oid - RGraph node identifier.
Graph node identifier or
Identifiers.INVALID_NODE if oid is not
an inherited node.public long lookupNode(long parentNode)
RGraph node identifier
of the given parent Graph node identifier.
parentNode - Parent Graph node identifier.
RGraph node identifier or
Identifiers.INVALID_NODE if parentNode is not
an inherited node.
public long addNode(Graph parentGraph,
long parentNode,
boolean exception)
Graph.
If parentGraph is a DbGraph, then a reference
to the given parentNode is built, otherwise
a full copy of the node is built into the RGraph.
parentGraph - Parent Graph to add (inherit) the node from.parentNode - Parent node to be added (inherited).exception - Forces throwing an exception if the node was
already inherited.
RGraph node identifier.
public long addNode(Graph parentGraph,
long parentNode)
Graph.
If parentGraph is a DbGraph, then a reference
to the given parentNode is built, otherwise
a full copy of the node is built into the RGraph.
parentGraph - Parent Graph to add (inherit) the node from.parentNode - Parent node to be added (inherited).
RGraph node identifier.RGraph.addNode(Graph, long, boolean)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||