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 TypeMethodDescriptionaddInnerNameTo
(BigraphEntity.InnerName innerName, BigraphEntity.InnerName toAttach) This method will attach the inner nametoAttach
toinnerName
while respecting a possibly existing link ofinnerName
.Creates a child node for the current node hierarchy with the given control label and connects it automatically to the given outer name.child
(String controlName, BigraphEntity.OuterName outerName) child
(PureBigraphBuilder<S>.Hierarchy thisOne) 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) create()
down()
Creates a new hierarchy builder where the last created node is the parent of this new hierarchy.linkInner
(BigraphEntity.InnerName innerName) Connect the previously created node to the given inner name.linkOuter
(BigraphEntity.OuterName outerName) Connect the previously created node to the given outer name.nodes()
void
nodesWithInner
(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
nodeWithInner
(BigraphEntity.InnerName innerName, Control control) Creates a new node with the given control and connects them to the inner name of the current bigraph.site()
Adds a site to the current parent.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
child
-
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
-
create
- Specified by:
create
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
-
child
public PureBigraphBuilder<S>.Hierarchy child(PureBigraphBuilder<S>.Hierarchy thisOne) throws ControlIsAtomicException - Throws:
ControlIsAtomicException
-
child
- Specified by:
child
in interfaceBigraphBuilder.NodeHierarchy<S extends AbstractEcoreSignature<? extends Control<?,
?>>>
-
child
public PureBigraphBuilder<S>.Hierarchy child(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:
child
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
-
child
public PureBigraphBuilder<S>.Hierarchy child(String controlName, BigraphEntity.OuterName outerName) throws InvalidConnectionException, TypeNotExistsException - Specified by:
child
in interfaceBigraphBuilder.NodeHierarchy<S extends AbstractEcoreSignature<? extends Control<?,
?>>> - Throws:
InvalidConnectionException
TypeNotExistsException
-
child
- Specified by:
child
in interfaceBigraphBuilder.NodeHierarchy<S extends AbstractEcoreSignature<? extends Control<?,
?>>>
-
site
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:
site
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
-
linkOuter
public PureBigraphBuilder<S>.Hierarchy linkOuter(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
-
linkOuter
public PureBigraphBuilder<S>.Hierarchy linkOuter(String outerName) throws TypeNotExistsException, InvalidConnectionException -
linkInner
public PureBigraphBuilder<S>.Hierarchy linkInner(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
-
linkInner
public PureBigraphBuilder<S>.Hierarchy linkInner(String innerName) throws LinkTypeNotExistsException, InvalidConnectionException -
nodesWithInner
public void nodesWithInner(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
-
nodeWithInner
public void nodeWithInner(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
-