Class PureBigraphBuilder.Hierarchy
java.lang.Object
org.bigraphs.framework.core.impl.pure.PureBigraphBuilder.Hierarchy
- All Implemented Interfaces:
BigraphBuilder.NodeHierarchy<S>
- Enclosing class:
- PureBigraphBuilder<S extends AbstractEcoreSignature<? extends Control<?,
?>>>
A bigraph consists of many node hierarchy. This inner class represents one of these.
These hierarchies can be built independently and added to the bigraph later.
-
Method Summary
Modifier and TypeMethodDescriptionCreates a child node for the current node hierarchy with the given control label and connects it automatically to the given outer name.addChild
(String controlName, BigraphEntity.OuterName outerName) addChild
(PureBigraphBuilder<S>.Hierarchy thisOne) addInnerNameTo
(BigraphEntity.InnerName innerName, BigraphEntity.InnerName toAttach) This method will attach the inner nametoAttach
toinnerName
while respecting a possibly existing link ofinnerName
.addSite()
Adds a site to the current parent.final PureBigraphBuilder<S>.Hierarchy
connectByEdge
(String... controls) final PureBigraphBuilder<S>.Hierarchy
connectByEdge
(Control... controls) Creates new child nodes and connects them with an edgefinal PureBigraphBuilder<S>.Hierarchy
connectByEdge
(PureBigraphBuilder<S>.Hierarchy... hierarchies) connectInnerNamesToNode
(BigraphEntity.InnerName... innerNames) void
connectNodesToInnerName
(BigraphEntity.InnerName innerName, Control... controls) Creates new nodes with the given controls and connects them to the inner name of the current bigraph.
Controls must not be atomic.void
connectNodeToInnerName
(BigraphEntity.InnerName innerName, Control control) Creates a new node with the given control and connects them to the inner name of the current bigraph.down()
Creates a new hierarchy builder where the last created node is the parent of this new hierarchy.linkToInner
(String innerName) linkToInner
(BigraphEntity.InnerName innerName) Connect the previously created node to the given inner name.linkToOuter
(String outerName) linkToOuter
(BigraphEntity.OuterName outerName) Connect the previously created node to the given outer name.nodes()
top()
Place the cursor to the top most element of the hierarchy.up()
Place the cursor one level up from the current position.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.bigraphs.framework.core.BigraphBuilder.NodeHierarchy
addChild
-
Method Details
-
getParent
-
up
Description copied from interface:BigraphBuilder.NodeHierarchy
Place the cursor one level up from the current position.- Specified by:
up
in interfaceBigraphBuilder.NodeHierarchy<S extends AbstractEcoreSignature<? extends Control<?,
?>>> - Returns:
- the same hierarchy
-
top
Description copied from interface:BigraphBuilder.NodeHierarchy
Place the cursor to the top most element of the hierarchy.- Specified by:
top
in interfaceBigraphBuilder.NodeHierarchy<S extends AbstractEcoreSignature<? extends Control<?,
?>>> - Returns:
- the same hierarchy
-
createBigraph
- Specified by:
createBigraph
in interfaceBigraphBuilder.NodeHierarchy<S extends AbstractEcoreSignature<? extends Control<?,
?>>>
-
down
Description copied from interface:BigraphBuilder.NodeHierarchy
Creates a new hierarchy builder where the last created node is the parent of this new hierarchy.One can go to the previous hierarchy by calling the
BigraphBuilder.NodeHierarchy.up()
method.- Specified by:
down
in interfaceBigraphBuilder.NodeHierarchy<S extends AbstractEcoreSignature<? extends Control<?,
?>>> - Returns:
- the new hierarchy
- Throws:
ControlIsAtomicException
-
addChild
public PureBigraphBuilder<S>.Hierarchy addChild(PureBigraphBuilder<S>.Hierarchy thisOne) throws ControlIsAtomicException - Throws:
ControlIsAtomicException
-
addChild
- Specified by:
addChild
in interfaceBigraphBuilder.NodeHierarchy<S extends AbstractEcoreSignature<? extends Control<?,
?>>>
-
addChild
public PureBigraphBuilder<S>.Hierarchy addChild(String controlName, String outerName) throws InvalidConnectionException Description copied from interface:BigraphBuilder.NodeHierarchy
Creates a child node for the current node hierarchy with the given control label and connects it automatically to the given outer name. The outer name is automatically created if it doesn't exists.- Specified by:
addChild
in interfaceBigraphBuilder.NodeHierarchy<S extends AbstractEcoreSignature<? extends Control<?,
?>>> - Parameters:
controlName
- the control of the newly created node.outerName
- the outer name to connect the newly created node- Returns:
- the same node hierarchy instance
- Throws:
InvalidConnectionException
-
addChild
public PureBigraphBuilder<S>.Hierarchy addChild(String controlName, BigraphEntity.OuterName outerName) throws InvalidConnectionException, TypeNotExistsException - Specified by:
addChild
in interfaceBigraphBuilder.NodeHierarchy<S extends AbstractEcoreSignature<? extends Control<?,
?>>> - Throws:
InvalidConnectionException
TypeNotExistsException
-
addChild
- Specified by:
addChild
in interfaceBigraphBuilder.NodeHierarchy<S extends AbstractEcoreSignature<? extends Control<?,
?>>>
-
addSite
Description copied from interface:BigraphBuilder.NodeHierarchy
Adds a site to the current parent.An
ControlIsAtomicException
is thrown if the parent's control is atomic.- Specified by:
addSite
in interfaceBigraphBuilder.NodeHierarchy<S extends AbstractEcoreSignature<? extends Control<?,
?>>> - Returns:
- adds a site to the current parent
- See Also:
-
connectInnerNamesToNode
public PureBigraphBuilder<S>.Hierarchy connectInnerNamesToNode(BigraphEntity.InnerName... innerNames) throws InvalidConnectionException, LinkTypeNotExistsException -
addInnerNameTo
public PureBigraphBuilder<S>.Hierarchy addInnerNameTo(BigraphEntity.InnerName innerName, BigraphEntity.InnerName toAttach) throws InvalidConnectionException, LinkTypeNotExistsException This method will attach the inner nametoAttach
toinnerName
while respecting a possibly existing link ofinnerName
. If no link is present forinnerName
, a new edge will be created.As a comparison, for example,
connectInnerNamesToNode(BigraphEntity.InnerName...)
is removing all existing linkings in order to link the given inner names with a node.- Parameters:
innerName
- the inner name that will be linked withtoAttach
via an existing link or a new onetoAttach
- the inner name that will be attached toinnerName
via an existing link frominnerName
, or a new one- Returns:
- Throws:
InvalidConnectionException
LinkTypeNotExistsException
-
connectByEdge
public final PureBigraphBuilder<S>.Hierarchy connectByEdge(PureBigraphBuilder<S>.Hierarchy... hierarchies) -
connectByEdge
public final PureBigraphBuilder<S>.Hierarchy connectByEdge(Control... controls) throws InvalidArityOfControlException Creates new child nodes and connects them with an edge- Parameters:
controls
- the controls of the new nodes- Returns:
- the builder hierarchy
- Throws:
InvalidArityOfControlException
- if nodes cannot be connected because of the control's arity
-
connectByEdge
public final PureBigraphBuilder<S>.Hierarchy connectByEdge(String... controls) throws InvalidArityOfControlException - Throws:
InvalidArityOfControlException
-
nodes
-
linkToOuter
public PureBigraphBuilder<S>.Hierarchy linkToOuter(BigraphEntity.OuterName outerName) throws TypeNotExistsException, InvalidConnectionException Connect the previously created node to the given outer name.- Parameters:
outerName
- the outer name to connect the node to- Returns:
- the current working node-hierarchy
- Throws:
LinkTypeNotExistsException
- the given outer name doesn't existInvalidArityOfControlException
- link couldn't be established because of the control's arityTypeNotExistsException
InvalidConnectionException
-
linkToOuter
public PureBigraphBuilder<S>.Hierarchy linkToOuter(String outerName) throws TypeNotExistsException, InvalidConnectionException -
linkToInner
public PureBigraphBuilder<S>.Hierarchy linkToInner(BigraphEntity.InnerName innerName) throws LinkTypeNotExistsException, InvalidConnectionException Connect the previously created node to the given inner name.- Parameters:
innerName
- the inner name to connect the node to- Returns:
- the current working node-hierarchy
- Throws:
LinkTypeNotExistsException
- the given inner name doesn't existInvalidArityOfControlException
- link couldn't be established because of the control's arityInvalidConnectionException
-
linkToInner
public PureBigraphBuilder<S>.Hierarchy linkToInner(String innerName) throws LinkTypeNotExistsException, InvalidConnectionException -
connectNodesToInnerName
public void connectNodesToInnerName(BigraphEntity.InnerName innerName, Control... controls) throws LinkTypeNotExistsException, InvalidConnectionException, ControlIsAtomicException Creates new nodes with the given controls and connects them to the inner name of the current bigraph.
Controls must not be atomic.- Parameters:
innerName
- an existing inner name of the bigraphcontrols
- the nodes to be created under the given controls- Throws:
InvalidConnectionException
- link couldn't be established because of the control's arityLinkTypeNotExistsException
- the given inner name doesn't existControlIsAtomicException
- if one of the given controls is atomic
-
connectNodeToInnerName
public void connectNodeToInnerName(BigraphEntity.InnerName innerName, Control control) throws InvalidConnectionException, LinkTypeNotExistsException, ControlIsAtomicException Creates a new node with the given control and connects them to the inner name of the current bigraph.- Parameters:
innerName
- an existing inner name of the bigraphcontrol
- the node to be created under the given control- Throws:
InvalidConnectionException
- link couldn't be established because of the control's arityLinkTypeNotExistsException
- the given inner name doesn't existControlIsAtomicException
-
getLastCreatedNode
-