public final class LapChain extends Object implements PoshElementListener
parameters
and Arguments of elements referenced by the
individual links.
Example1: There is only drive that calls some action. In such case, there is
only one link of the chain - the call from the chain to the action.
Example2: There is drive action that references AP1 and that AP1 references
some action. In such case chain has two links - first link represents
reference from drive action to AP1 and second link represents reference from
AP1 to the action..| Constructor and Description |
|---|
LapChain()
Create new chain, It has no
ChainLink. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
addChainListener(ILapChainListener listener) |
VariableContext |
createContext() |
<REFERENCE extends PoshElement & IReferenceElement> |
derive(REFERENCE reference)
Create and return new chain using this one as the base.
|
<REFERENCED_NODE extends PoshElement & IParametrizedElement> |
derive(TriggeredAction action,
REFERENCED_NODE referencedNode)
Return new chain using this one as the base and create new link from the
reference of action to AP.
|
boolean |
equals(Object obj) |
static LapChain |
fromPath(PoshPlan plan,
LapPath path)
Create chain from the @path.
|
int |
hashCode() |
void |
childElementAdded(PoshElement parent,
PoshElement child)
Event handler will be notified that parent has added a new child among
its children.
|
void |
childElementMoved(PoshElement parent,
PoshElement child,
int oldIndex,
int newIndex)
Evenet handler will be notified that parent has moved a child.
|
void |
childElementRemoved(PoshElement parent,
PoshElement child,
int removedChildPosition)
Event handler will be notified when parent has removed child.
|
void |
propertyChange(PropertyChangeEvent evt) |
void |
register()
Add the chain as listener for changes of elements of links.
|
boolean |
removeChainListener(ILapChainListener listener) |
int |
size()
How many links of chain are there.
|
LapChain |
subchain(int beginIndex,
int endIndex)
Create subchain created from links of this chain.
|
LapPath |
toPath()
Create
LapPath from the chain. |
String |
toString() |
void |
unregister()
Remove the chain as listener of all links elements.
|
public static LapChain fromPath(PoshPlan plan, LapPath path)
path - Path that will be used as source of info.public LapPath toPath()
LapPath from the chain. Since not every LapPath
can be represented by the chain (e.g. LapType.COMPETENCE_ELEMENT),
it is not 1-on-1 mapping. Resulting LapPath always starts with
/P:0 and ends with type of referenced node of last link. If there is not
referenced node at last link (e.g. Sense or TriggeredAction),
the last link of path is LapType of IChainLink.getReference().
If chain is empty, return LapPath.DRIVE_COLLECTION_PATH.public void register()
ILapChainListener unless it is registered.public void unregister()
public <REFERENCED_NODE extends PoshElement & IParametrizedElement> LapChain derive(TriggeredAction action, REFERENCED_NODE referencedNode)
action - action referencing the AP. Basis of the link.actionPattern - referenced AP.public <REFERENCE extends PoshElement & IReferenceElement> LapChain derive(REFERENCE reference)
reference - Reference to action or sense in work executorpublic LapChain subchain(int beginIndex, int endIndex)
beginIndex - Begin index of subchain, inclusiveendIndex - End index of subchain, exclusivepublic int size()
public VariableContext createContext()
VariableContext for current chain.public void childElementAdded(PoshElement parent, PoshElement child)
PoshElementListenerchildElementAdded in interface PoshElementListenerparent - parent that has a new childchild - Child that has been added.public void childElementMoved(PoshElement parent, PoshElement child, int oldIndex, int newIndex)
PoshElementListenerchildElementMoved in interface PoshElementListenerparent - Parent element of child.child - child that has been moved.oldIndex - Index of the child before move.newIndex - Absolute position of the moved child with its own
type. E.g. DriveCollection has two types of children, Senses
and DriveElement. First sense has absolute index 0 and first
drive has absolute index 0.public void childElementRemoved(PoshElement parent, PoshElement child, int removedChildPosition)
PoshElementListenerchildElementRemoved in interface PoshElementListenerparent - parent element of childchild - child element that has been removedremovedChildPosition - What was position of removed child among
childrenpublic void propertyChange(PropertyChangeEvent evt)
propertyChange in interface PropertyChangeListenerpublic boolean addChainListener(ILapChainListener listener)
public boolean removeChainListener(ILapChainListener listener)
Copyright © 2018 AMIS research group, Faculty of Mathematics and Physics, Charles University in Prague, Czech Republic. All rights reserved.