|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object i3.dragos.gm.core.proxy.GraphEntityProxy i3.dragos.gm.core.proxy.GraphProxy
public class GraphProxy
A GraphProxy
delegates all method calls to the underlying
graph except for those that access fields which are used after a graph has
been deleted.
Field Summary |
---|
Fields inherited from class i3.dragos.gm.core.proxy.GraphEntityProxy |
---|
proxiedEntity |
Constructor Summary | |
---|---|
GraphProxy(Graph g)
Constructs a new wrapper for a graph. |
Method Summary | |
---|---|
void |
clear()
Removes everything in the graph. |
boolean |
contains(GraphEntity ge)
Returns true if the specified graph element is in the graph. |
Edge |
createEdge(GraphEntity source,
GraphEntity target,
EdgeClass type)
Creates a new edge between the specified source and target graph element, which will belong to this graph and returns it. |
Graph |
createGraph(GraphClass type)
Creates a new graph, which will belong to this graph, and returns it. |
Node |
createNode(NodeClass type)
Creates a new node, which will belong to this graph and returns it. |
Relation |
createRelation(RelationClass type)
Creates a new relation, which will belong to this graph and returns it. |
java.util.Collection<? extends Edge> |
getAllEdgesOfGraph()
Returns a collection containing all edges stored in the graph. |
java.util.Collection<? extends Edge> |
getAllEdgesOfGraph(EdgeClass type,
boolean includeSubClasses)
Returns a collection containing all edges of the specified type stored in the graph. |
java.util.Collection<? extends GraphEntity> |
getAllGraphEntitiesOfGraph()
Returns a collection containing all graph entities stored in the graph. |
java.util.Collection<? extends GraphEntity> |
getAllGraphEntitiesOfGraph(GraphEntityClass type,
boolean includeSubClasses)
Returns a collection containing all graph entities of the specified type stored in the graph. |
java.util.Collection<? extends Graph> |
getAllGraphsOfGraph()
Returns a collection containing all graphs stored in the graph. |
java.util.Collection<? extends Graph> |
getAllGraphsOfGraph(GraphClass type,
boolean includeSubClasses)
Returns a collection containing the graphs of the specified type stored in the graph. |
java.util.Collection<? extends Node> |
getAllNodesOfGraph()
Returns a collection containing all nodes stored in the graph. |
java.util.Collection<? extends Node> |
getAllNodesOfGraph(NodeClass type,
boolean includeSubClasses)
Returns a collection containing all nodes of the specified type stored in the graph. |
java.util.Collection<? extends Relation> |
getAllRelationsOfGraph()
Returns a collection containing all relations stored in the graph. |
java.util.Collection<? extends Relation> |
getAllRelationsOfGraph(RelationClass type,
boolean includeSubClasses)
Returns a collection containing all relations of the specified type stored in the graph. |
GraphClass |
getGraphClass()
Returns the type of the graph. |
java.util.Collection<? extends GraphEntity> |
getGraphEntitiesByAttributeValue(Attribute attribute,
java.io.Serializable value)
Returns a collection of graph elements ( GraphEntity ) which
have the requested value for the attribute. |
java.lang.String |
getName()
Returns the name of the graph. |
boolean |
hasParent()
Returns true if the graph is contained in another graph,
false otherwise. |
boolean |
isEmpty()
Returns true if not even a single graph element (graph,
node, edge, etc) is contained in the graph. |
void |
removeAllEdges()
Removes all edges froms the graph. |
void |
removeAllEdges(EdgeClass type,
boolean includeSubClasses)
Removes all edges of the specified type from the graph. |
void |
removeAllGraphs()
Removes all graphs froms the graph. |
void |
removeAllGraphs(GraphClass type,
boolean includeSubClasses)
Removes all graphs of the specified type from the graph. |
void |
removeAllNodes()
Removes all nodes froms the graph. |
void |
removeAllNodes(NodeClass type,
boolean includeSubClasses)
Removes all nodes of the specified type from the graph. |
void |
removeAllRelations()
Removes all relations froms the graph. |
void |
removeAllRelations(RelationClass type,
boolean includeSubClasses)
Removes all relations of the specified type from the graph. |
void |
removeGraphEntity(GraphEntity graphEntity)
Removes the graph entity from this graph. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface i3.dragos.gm.core.GraphEntity |
---|
equals, getAdjacentGraphEntities, getAdjacentRelations, getAdjacentRelations, getAllValidAttributeValues, getAttributeValue, getDataSourceURL, getEdges, getEdges, getGraphEntityClass, getInternalIdentifier, getParent, getRelationEnds, getRelationEnds, getRelationEnds, getWrappedGraphEntity, hashCode, isAttributeValid, isIncident, isIncident, putAttributeValue, setAttributeInvalid |
Methods inherited from interface i3.dragos.gm.core.schema.MetaAttributable |
---|
getAllMetaAttributes, getMetaAttribute, isMetaAttributeKeyReserved, isMetaAttributeSet, setMetaAttribute, unsetMetaAttribute |
Methods inherited from interface i3.dragos.gm.core.schema.ExistenceCheckable |
---|
checkExistence, checkExistenceOptional |
Constructor Detail |
---|
public GraphProxy(Graph g)
g
- The graph to wrap.Method Detail |
---|
public GraphClass getGraphClass() throws DragosException
getGraphClass
in interface Graph
DragosException
- if something went wrong.public java.lang.String getName()
null
is always returned.
getName
in interface Graph
public boolean hasParent() throws DragosException
true
if the graph is contained in another graph,
false
otherwise.
hasParent
in interface Graph
true
if the graph is contained in another graph,
false
otherwise.
DragosException
- if something went wrong.public boolean isEmpty() throws DragosException
true
if not even a single graph element (graph,
node, edge, etc) is contained in the graph.
isEmpty
in interface Graph
true
if the graph is empty, false
otherwise.
DragosException
- if something went wrong.public void clear() throws DragosException
Note: This method follows the same rules as the methods for removing edges, nodes, graphs and relations individually!
clear
in interface Graph
DragosException
- if something went wrong.public boolean contains(GraphEntity ge) throws DragosException
true
if the specified graph element is in the graph.
contains
in interface Graph
ge
- The requested graph element (must not be null
).
true
if the graph element is contained in the graph and
false
otherwise.
DragosException
- if anything went wrong.public void removeGraphEntity(GraphEntity graphEntity) throws EntityNotFoundException, DragosException
Deletion proceeds as follows:
GraphEntity.getRelationEnds(ConnectionMode)
using
ConnectionMode.ANY_SET
as parameter) are removed.
Graph.clear()
.Relation.removeAllRelationEndsOfRelation()
.Implementation notice: Some edges and relation ends might already be deleted due to cascading removal of entities processed before, so take care when iterating through the instances.
removeGraphEntity
in interface Graph
graphEntity
- The graph, which shall be deleted.
EntityNotFoundException
- if the graph entity could not be found in the graph.
DragosException
- if something else went wrong.public java.util.Collection<? extends GraphEntity> getAllGraphEntitiesOfGraph() throws EntityNotFoundException, DragosException
getAllGraphEntitiesOfGraph
in interface Graph
DragosException
- if anything went wrong.
EntityNotFoundException
public java.util.Collection<? extends GraphEntity> getAllGraphEntitiesOfGraph(GraphEntityClass type, boolean includeSubClasses) throws EntityNotFoundException, DragosException
getAllGraphEntitiesOfGraph
in interface Graph
type
- The type of the edges (null
means "any type").includeSubClasses
- If and only if true
, this method
will also match graph entities whose GraphEntityClass is a subclass of the specified type.
EntityNotFoundException
- if the requested type could not be found.
DragosException
- if anything went wrong.public Graph createGraph(GraphClass type) throws EntityNotFoundException, DragosException, java.lang.IllegalArgumentException
Since graphs created in other graphs are not top-level graphs,
their name will be null
by definition.
createGraph
in interface Graph
type
- The graph's type.
EntityNotFoundException
- if the type for the graph couldn't be
found.
GraphEntityInstantiationException
- if type is declared as an abstract class.
DragosException
- if something else went wrong.
java.lang.IllegalArgumentException
- if type is null
.public void removeAllGraphs(GraphClass type, boolean includeSubClasses) throws EntityNotFoundException, DragosException
Graph.removeGraphEntity(GraphEntity)
for details.
removeAllGraphs
in interface Graph
type
- The type of the graphs to be deleted (null
means "any type").includeSubClasses
- If and only if true
, this method will
also match graphs whose graph class is a subclass of the specified type.
EntityNotFoundException
- if the type could not be found.
DragosException
- if something else went wrong.public void removeAllGraphs() throws DragosException
Graph.removeGraphEntity(GraphEntity)
for details.
removeAllGraphs
in interface Graph
DragosException
- if anything went wrong.public java.util.Collection<? extends Graph> getAllGraphsOfGraph(GraphClass type, boolean includeSubClasses) throws EntityNotFoundException, DragosException
getAllGraphsOfGraph
in interface Graph
type
- The type of the graphs (null
means "any type").includeSubClasses
- If and only if true
, this method
will also match graphs whose GraphClass is a subclass of the specified type.
EntityNotFoundException
- if the requested type could not be found.
DragosException
- if anything went wrong.public java.util.Collection<? extends Graph> getAllGraphsOfGraph() throws DragosException
getAllGraphsOfGraph
in interface Graph
DragosException
- if anything went wrong.public Node createNode(NodeClass type) throws EntityNotFoundException, DragosException, java.lang.IllegalArgumentException
createNode
in interface Graph
type
- The type of the new node.
EntityNotFoundException
- if the type for the node couldn't be
found.
GraphEntityInstantiationException
- if type is declared as an abstract class.
DragosException
- if something else went wrong.
java.lang.IllegalArgumentException
- if type is null
.public void removeAllNodes(NodeClass type, boolean includeSubClasses) throws EntityNotFoundException, DragosException
Graph.removeGraphEntity(GraphEntity)
for details.
removeAllNodes
in interface Graph
type
- The type of the nodes to be deleted (null
means "any type").includeSubClasses
- If and only if true
, this method will
also match nodes whose NodeClass is a subclass of the specified type.
EntityNotFoundException
- if the type could not be found.
DragosException
- if something else went wrong.public void removeAllNodes() throws EntityInUseException, DragosException
Graph.removeGraphEntity(GraphEntity)
for details.
removeAllNodes
in interface Graph
EntityInUseException
- if one of the nodes is in use.
DragosException
- if anything went wrong.public java.util.Collection<? extends Node> getAllNodesOfGraph(NodeClass type, boolean includeSubClasses) throws EntityNotFoundException, DragosException
getAllNodesOfGraph
in interface Graph
type
- The type of the nodes (null
means "any type").includeSubClasses
- If and only if true
, this method
will also match nodes whose NodeClass is a subclass of the specified type.
EntityNotFoundException
- if the requested type could not be found.
DragosException
- if anything went wrong.public java.util.Collection<? extends Node> getAllNodesOfGraph() throws DragosException
getAllNodesOfGraph
in interface Graph
DragosException
- if anything went wrong.public Edge createEdge(GraphEntity source, GraphEntity target, EdgeClass type) throws EntityNotFoundException, DragosException, java.lang.IllegalArgumentException
createEdge
in interface Graph
source
- The source graph element of the edge (may be null
).target
- The target graph element of the edge (may be null
).type
- The type of the new edge (must not be null
).
EntityNotFoundException
- if the source or the target were not
null
and could not be found, or if
the type for the edge could not be found.
GraphEntityInstantiationException
- if type is declared as an abstract class.
DragosException
- if something else went wrong.
java.lang.IllegalArgumentException
- if type is null
.public void removeAllEdges(EdgeClass type, boolean includeSubClasses) throws EntityNotFoundException, DragosException
Graph.removeGraphEntity(GraphEntity)
for details.
removeAllEdges
in interface Graph
type
- The type of the edges to be deleted (null
means "any type").includeSubClasses
- If and only if true
, this method
will also match edges whose EdgeClass is a subclass of the specified type.
EntityNotFoundException
- if the type could not be found.
DragosException
- if something else went wrong.public void removeAllEdges() throws EntityInUseException, DragosException
Graph.removeGraphEntity(GraphEntity)
for details.
removeAllEdges
in interface Graph
EntityInUseException
- if one of the edges is in use.
DragosException
- if anything went wrong.public java.util.Collection<? extends Edge> getAllEdgesOfGraph(EdgeClass type, boolean includeSubClasses) throws EntityNotFoundException, DragosException
getAllEdgesOfGraph
in interface Graph
type
- The type of the edges (null
means "any type").includeSubClasses
- If and only if true
, this method
will also match edges whose EdgeClass is a subclass of the specified type.
EntityNotFoundException
- if the requested type could not be found.
DragosException
- if anything went wrong.public java.util.Collection<? extends Edge> getAllEdgesOfGraph() throws DragosException
getAllEdgesOfGraph
in interface Graph
DragosException
- if anything went wrong.public Relation createRelation(RelationClass type) throws EntityNotFoundException, DragosException, java.lang.IllegalArgumentException
createRelation
in interface Graph
type
- The type of the new relation.
EntityNotFoundException
- if the type for the relation couldn't be
found.
GraphEntityInstantiationException
- if type is declared as an abstract class.
DragosException
- if something else went wrong.
java.lang.IllegalArgumentException
- if type is null
.public void removeAllRelations(RelationClass type, boolean includeSubClasses) throws EntityNotFoundException, DragosException
Graph.removeGraphEntity(GraphEntity)
for details.
removeAllRelations
in interface Graph
type
- The type of the relations to be deleted (null
means "any type").includeSubClasses
- If and only if true
, this method
will also match relations whose RelationClass is a subclass of the specified type.
EntityNotFoundException
- if the type could not be found.
DragosException
- if something else went wrong.public void removeAllRelations() throws EntityInUseException, DragosException
Graph.removeGraphEntity(GraphEntity)
for details.
removeAllRelations
in interface Graph
EntityInUseException
- if one of the edges is in use.
DragosException
- if anything went wrong.public java.util.Collection<? extends Relation> getAllRelationsOfGraph(RelationClass type, boolean includeSubClasses) throws EntityNotFoundException, DragosException
getAllRelationsOfGraph
in interface Graph
type
- The type of the relations (null
means "any type").includeSubClasses
- If and only if true
, this method
will also match relations whose RelationClass is a subclass of the specified type.
EntityNotFoundException
- if the requested type could not be found.
DragosException
- if anything went wrong.public java.util.Collection<? extends Relation> getAllRelationsOfGraph() throws DragosException
getAllRelationsOfGraph
in interface Graph
DragosException
- if anything went wrong.public java.util.Collection<? extends GraphEntity> getGraphEntitiesByAttributeValue(Attribute attribute, java.io.Serializable value) throws EntityNotFoundException, DragosException
GraphEntity
) which
have the requested value for the attribute.
getGraphEntitiesByAttributeValue
in interface Graph
attribute
- The attribute.value
- The requested value. May be null
.
GraphEntity
) which
have the requested value for the attribute.
EntityNotFoundException
- if the attribute could not be found.
DragosException
- if anything went wrong.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |