cz.cuni.amis.pogamut.sposh.elements
Class PoshDummyElement<THIS extends PoshElement,PARENT extends PoshElement>
java.lang.Object
cz.cuni.amis.pogamut.sposh.elements.PoshElement<THIS,PARENT>
cz.cuni.amis.pogamut.sposh.elements.PoshDummyElement<THIS,PARENT>
- Direct Known Subclasses:
- NamedLapElement, PoshPlan
public abstract class PoshDummyElement<THIS extends PoshElement,PARENT extends PoshElement>
- extends PoshElement<THIS,PARENT>
This is class used as intermediate class between PoshElement and DataNodes of
POSH elements. Some common functions are implemented here.
- Author:
- HonzaH
Field Summary |
static String |
IDENT_PATTERN
Regular pattern, only text that matches this pattern can be a name of the
POSH element. |
Methods inherited from class cz.cuni.amis.pogamut.sposh.elements.PoshElement |
addElementListener, emitChildDeleted, emitChildMove, emitChildNode, firePropertyChange, getDataFlavor, getElementListeners, getChildDataNodes, getNumberOfChildInstances, getParent, getRootNode, getType, isChildOfParent, moveChild, removeElementListener, setParent |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
IDENT_PATTERN
public static final String IDENT_PATTERN
- Regular pattern, only text that matches this pattern can be a name of the
POSH element. This pattern must be same as token
NAME
in the PoshParser.jj
Because of dash (-), not all strings that match this pattern are FQN.
- See Also:
- Constant Field Values
PoshDummyElement
public PoshDummyElement()
moveChildInList
protected <T extends PoshElement> boolean moveChildInList(List<T> list,
T child,
int newIndex)
- Take the @list of elements and one @child of the @list. Move the @child
so that it is at the @newIndex and the rest of elements keep their order.
Once it is done, emit the event. If @child is not part of the @list,
throw
NoSuchElementException
, if @newIndex is same as the index
the @child is currently at, don't do anything.
- Type Parameters:
T
- - Parameters:
list
- child
- newIndex
- Index
- Returns:
- did method move and emited?
isUsedName
protected static boolean isUsedName(String name,
List<? extends NamedLapElement> elements)
- Is passed name used by one of elements?
- Parameters:
name
- name to be testedelements
- elements againt which the test is done
- Returns:
- true if name is used, false otherwise
getUnusedName
protected static String getUnusedName(String template,
List<? extends NamedLapElement> elements)
- Get valid name for new element, but name can't be same as any name used
by passed elements.
- Parameters:
template
- string used as prefix of created nameelements
- elements that must have different name that created name
- Returns:
- valid name that can be immediately used as OK name of new drive.
Copyright © 2012 AMIS research group, Faculty of Mathematics and Physics, Charles University in Prague, Czech Republic. All Rights Reserved.