- All Implemented Interfaces:
GraphContext,GraphManagerContext,GraphObject,SecGraph,ProducingNode,Manageable,Shareable,RegistryContext,Graph,Cloneable
@HasModel(Compiletime.class)
public final class SecGraphRef
extends ItemReference<SecGraph>
implements SecGraph
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsFields inherited from class de.grogra.pf.registry.ItemReference
item, itemResolved, name$FIELD, object, objectResolvedFields inherited from interface de.grogra.graph.object.sg.SecGraph
PRODUCTION_ROOT, QUERY_ROOT -
Constructor Summary
ConstructorsConstructorDescriptionSecGraphRef(String name) SecGraphRef(String name, Node root) SecGraphRef(String name, GraphContext inp) -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(GraphContext imp) static SecGraphall(ObjectConsumer consumer) voidapply the given SecGraph on this SecGraphvoidApply a RGG function on the SecGraphvoidApply an XL Query on the SecGraphbooleancanEnumerateEdges(EdgeDirection dir, boolean constEdge, Serializable edge) booleancanEnumerateNodes(Type type) Can nodes of the specifiedtypebe enumerated?voidclear()removes all Nodes except the rootclone the graph of the rootnode and returns itprotected ItemcreateItem(RegistryContext ctx, String directory, String name) createMatcher(Pattern pred, XBitSet providedConstants, IntList neededConstantsOut) Creates an instance ofProducer.Creates a query state to be used for queries which use this graph.longderive()Gives an array of node types and number contained in the GraphObjectvoidenumerateEdges(Object node, EdgeDirection dir, Type edgeType, QueryState qs, int toIndex, int patternIndex, Serializable pattern, int matchIndex, MatchConsumer consumer, int arg) voidenumerateNodes(Type type, QueryState qs, int tp, MatchConsumer consumer, int arg) This methods enumerates all nodes of this graph of the given type to the givenMatchConsumervia the given query state.voidenumerateSpaces(Object node, EdgeDirection dir, Type edgeType, QueryState qs, int toIndex, int patternIndex, Serializable pattern, int matchIndex, MatchConsumer consumer, int arg) This method enumerates all edges that possibly related 2 nodes with a spacing pattern inbetween them.voidexecute()run this SecGraph as a rule on the MainGraphvoidrun this SecGraph as a rule on the given secGraphstatic SecGraphRefgetGraph()Return the graph manager of the GraphObject.create a new producer to initialize the GraphgetModel()Returns this graph's run-time model.Return a node of the given namegetProductionRoot(boolean create) getQueryRoot(boolean create) Returns theRegistrywhich is linked with this instance.getRoot()Returns the root node of this graph.Return the root node of the GraphObject, i.e. the root of the object loadedReturns the root node of the type graph for this graphvoidfunction triggered by the saving of the projectbooleantest if this SecGraph incldues the SecGraph SGbooleantest if this SecGraph incldues the given SecGraph or if the query SecGraph of this graph is included in the given SecGraphbooleantest if this graph is included in the ProjectGraphbooleaninProjectGraph(boolean asQuery) test if this graph is included in the ProjectGraph or if the query SecGraph of this graph is included in the Project Graphbooleancheck if the secgraph includes a queryRootbooleancheck if the secgraph includes a QueryRoot and a ProductionRootquery()voidset the project graph to be teh current onevoidreload()If the GraphObject uses some modules defined in the project, reload forces the modules in the GraphObject to be relinked after compilationresolve()Resolves the real object if a reference is used If the real object is used the function returns it selfvoidsetAutoRecreate(boolean b) defines if the SecGraph is automatically recreated if the model is savedvoidset this graph to be the currently used onevoidsetRootNode(Node n) Set the rootnode of a GraphObject object.Returns the ordered scale values of the nodes in the type graphcreates a Node holding a instanciation of the SecGraphtoNode()voidOpens the 2d view of the current graphvoidOpens the 3d view of the current graphvoidwrite()Override the file GraphObject in the project with its current version.Methods inherited from class de.grogra.pf.registry.ItemReference
equals, findChildrenWithoutExtension, getName, hashCode, removeExtension, resolveItem, resolveObjectMethods inherited from class de.grogra.persistence.ShareableBase
addReference, appendReferencesTo, fieldModified, getProvider, getStamp, initProvider, manageableReadResolve, manageableWriteReplace, removeReferenceMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface de.grogra.graph.object.GraphObject
getName
-
Field Details
-
$TYPE
-
-
Constructor Details
-
SecGraphRef
-
SecGraphRef
-
SecGraphRef
-
-
Method Details
-
getManageableType
- Specified by:
getManageableTypein interfaceManageable
-
get
-
resolve
Description copied from interface:GraphObjectResolves the real object if a reference is used If the real object is used the function returns it self- Specified by:
resolvein interfaceGraphObject- Returns:
-
toSecGraph
-
all
-
createItem
- Overrides:
createItemin classItemReference<SecGraph>
-
setRootNode
Description copied from interface:GraphObjectSet the rootnode of a GraphObject object.- Specified by:
setRootNodein interfaceGraphObject- Parameters:
n-
-
getRootNode
Description copied from interface:GraphObjectReturn the root node of the GraphObject, i.e. the root of the object loaded- Specified by:
getRootNodein interfaceGraphObject- Returns:
- a Node
-
cloneGraph
Description copied from interface:GraphObjectclone the graph of the rootnode and returns it- Specified by:
cloneGraphin interfaceGraphObject- Returns:
- Throws:
CloneNotSupportedException
-
write
public void write()Description copied from interface:GraphObjectOverride the file GraphObject in the project with its current version. Required on GraphObject created in RGG to be saved- Specified by:
writein interfaceGraphObject
-
reload
public void reload()Description copied from interface:GraphObjectIf the GraphObject uses some modules defined in the project, reload forces the modules in the GraphObject to be relinked after compilation- Specified by:
reloadin interfaceGraphObject
-
clear
public void clear()Description copied from interface:SecGraphremoves all Nodes except the root -
describes
Description copied from interface:GraphObjectGives an array of node types and number contained in the GraphObject- Specified by:
describesin interfaceGraphObject- Returns:
-
getRegistry
Description copied from interface:RegistryContextReturns theRegistrywhich is linked with this instance.- Specified by:
getRegistryin interfaceRegistryContext- Returns:
- the registry linked with this instance
-
getGraph
Description copied from interface:GraphObjectReturn the graph manager of the GraphObject. It is different from the graph manager of the project invalid input: '&' workbench.- Specified by:
getGraphin interfaceGraphContext- Specified by:
getGraphin interfaceGraphManagerContext- Specified by:
getGraphin interfaceGraphObject- Returns:
-
getNode
Description copied from interface:GraphObjectReturn a node of the given name- Specified by:
getNodein interfaceGraphObject- Parameters:
key- : the name of the type of node
-
apply
Description copied from interface:SecGraphApply a RGG function on the SecGraph -
applyXL
Description copied from interface:SecGraphApply an XL Query on the SecGraph -
getRGGGraph
- Specified by:
getRGGGraphin interfaceSecGraph
-
toInstance
Description copied from interface:SecGraphcreates a Node holding a instanciation of the SecGraph- Specified by:
toInstancein interfaceSecGraph- Returns:
- the Node
-
toNode
-
setAutoRecreate
public void setAutoRecreate(boolean b) Description copied from interface:SecGraphdefines if the SecGraph is automatically recreated if the model is saved- Specified by:
setAutoRecreatein interfaceSecGraph- Parameters:
b- sets if recreated or not
-
handleSaveEvent
public void handleSaveEvent()Description copied from interface:SecGraphfunction triggered by the saving of the project- Specified by:
handleSaveEventin interfaceSecGraph
-
producer$begin
- Specified by:
producer$beginin interfaceSecGraph
-
getInitalProducer
Description copied from interface:SecGraphcreate a new producer to initialize the Graph- Specified by:
getInitalProducerin interfaceSecGraph- Returns:
-
setCurrent
public void setCurrent()Description copied from interface:SecGraphset this graph to be the currently used one- Specified by:
setCurrentin interfaceSecGraph
-
releaseCurrent
public void releaseCurrent()Description copied from interface:SecGraphset the project graph to be teh current one- Specified by:
releaseCurrentin interfaceSecGraph
-
includes
public boolean includes(SecGraph sg) throws de.grogra.graph.object.sg.impl.exception.NoQueryGraphException Description copied from interface:SecGraphtest if this SecGraph incldues the SecGraph SG -
inProjectGraph
public boolean inProjectGraph() throws de.grogra.graph.object.sg.impl.exception.NoQueryGraphExceptionDescription copied from interface:SecGraphtest if this graph is included in the ProjectGraph- Specified by:
inProjectGraphin interfaceSecGraph- Returns:
- Throws:
de.grogra.graph.object.sg.impl.exception.NoQueryGraphException
-
includes
public boolean includes(SecGraph sg, boolean asQuery) throws de.grogra.graph.object.sg.impl.exception.NoQueryGraphException Description copied from interface:SecGraphtest if this SecGraph incldues the given SecGraph or if the query SecGraph of this graph is included in the given SecGraph -
inProjectGraph
public boolean inProjectGraph(boolean asQuery) throws de.grogra.graph.object.sg.impl.exception.NoQueryGraphException Description copied from interface:SecGraphtest if this graph is included in the ProjectGraph or if the query SecGraph of this graph is included in the Project Graph- Specified by:
inProjectGraphin interfaceSecGraph- Parameters:
asQuery-- Returns:
- Throws:
de.grogra.graph.object.sg.impl.exception.NoQueryGraphException
-
execute
public void execute() throws de.grogra.graph.object.sg.impl.exception.NoRuleGraphExceptionDescription copied from interface:SecGraphrun this SecGraph as a rule on the MainGraph -
execute
public void execute(SecGraph sg) throws de.grogra.graph.object.sg.impl.exception.NoRuleGraphException Description copied from interface:SecGraphrun this SecGraph as a rule on the given secGraph -
apply
public void apply(SecGraph rule) throws de.grogra.graph.object.sg.impl.exception.NoRuleGraphException Description copied from interface:SecGraphapply the given SecGraph on this SecGraph -
getQueryRoot
- Specified by:
getQueryRootin interfaceSecGraph
-
getProductionRoot
- Specified by:
getProductionRootin interfaceSecGraph
-
query
-
production
- Specified by:
productionin interfaceSecGraph
-
isQueryGraph
public boolean isQueryGraph()Description copied from interface:SecGraphcheck if the secgraph includes a queryRoot- Specified by:
isQueryGraphin interfaceSecGraph- Returns:
-
isRuleGraph
public boolean isRuleGraph()Description copied from interface:SecGraphcheck if the secgraph includes a QueryRoot and a ProductionRoot- Specified by:
isRuleGraphin interfaceSecGraph- Returns:
-
produceNode
- Specified by:
produceNodein interfaceProducingNode
-
view3d
Description copied from interface:GraphObjectOpens the 3d view of the current graph- Specified by:
view3din interfaceGraphObject- Parameters:
ctx-
-
view2d
Description copied from interface:GraphObjectOpens the 2d view of the current graph- Specified by:
view2din interfaceGraphObject- Parameters:
ctx-
-
add
-
getModel
Description copied from interface:GraphReturns this graph's run-time model. -
createQueryState
Description copied from interface:GraphCreates a query state to be used for queries which use this graph. The returned query state has to be an instance of the type defined byCompiletimeModel.getQueryStateType()of the corresponding compile-time model.- Specified by:
createQueryStatein interfaceGraph- Returns:
- a new query state
-
createProducer
Description copied from interface:GraphCreates an instance ofProducer. This factory method creates an instance of a subclass ofProducerwhich will be exclusively used later on in the context of the current match represented byqs. The instance must be an instance of the class returned byCompiletimeModel.getProducerType()for the corresponding compile-time model.The usage of producers is specified by the XL programming language.
- Specified by:
createProducerin interfaceGraph- Parameters:
qs- query state which holds current match for which the producer shall produce a replacement- Returns:
- a producer for use in the context of
qs
-
createMatcher
public Pattern.Matcher createMatcher(Pattern pred, XBitSet providedConstants, IntList neededConstantsOut) - Specified by:
createMatcherin interfaceGraph
-
canEnumerateNodes
Description copied from interface:GraphCan nodes of the specifiedtypebe enumerated? This method returnstrueiff this graph can enumerate nodes of the giventypeusing the methodGraph.enumerateNodes(de.grogra.reflect.Type, de.grogra.xl.query.QueryState, int, de.grogra.xl.query.MatchConsumer, int).- Specified by:
canEnumerateNodesin interfaceGraph- Parameters:
type- the type of nodes- Returns:
trueiff nodes oftypecan be enumerated
-
enumerateNodes
Description copied from interface:GraphThis methods enumerates all nodes of this graph of the given type to the givenMatchConsumervia the given query state. I.e., for every nodecof this extent that has typetype, the following statement is executed:qs.amatch (tp, c, consumer, arg);- Specified by:
enumerateNodesin interfaceGraph- Parameters:
type- the type of nodesqs- the query state on which theamatch-method has to be invokedtp- the index-parameter for theamatch-methodconsumer- the consumer-parameter for theamatch-methodarg- the arg-parameter for theamatch-method
-
canEnumerateEdges
- Specified by:
canEnumerateEdgesin interfaceGraph
-
enumerateEdges
public void enumerateEdges(Object node, EdgeDirection dir, Type edgeType, QueryState qs, int toIndex, int patternIndex, Serializable pattern, int matchIndex, MatchConsumer consumer, int arg) - Specified by:
enumerateEdgesin interfaceGraph
-
getRoot
Description copied from interface:GraphReturns the root node of this graph. -
getTypeRoot
Description copied from interface:GraphReturns the root node of the type graph for this graph- Specified by:
getTypeRootin interfaceGraph- Returns:
- the root of the type graph
-
enumerateSpaces
public void enumerateSpaces(Object node, EdgeDirection dir, Type edgeType, QueryState qs, int toIndex, int patternIndex, Serializable pattern, int matchIndex, MatchConsumer consumer, int arg) Description copied from interface:GraphThis method enumerates all edges that possibly related 2 nodes with a spacing pattern inbetween them.- Specified by:
enumerateSpacesin interfaceGraph- Parameters:
node-dir-edgeType-qs-toIndex-patternIndex-pattern-matchIndex-consumer-arg-
-
sortedTypeGraph
Description copied from interface:GraphReturns the ordered scale values of the nodes in the type graph- Specified by:
sortedTypeGraphin interfaceGraph- Returns:
- HashMap instance containing mappings from the type graph nodes to scale values
-
derive
public long derive()
-