|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object cz.cuni.amis.pogamut.sposh.elements.PoshElement<THIS,PARENT> cz.cuni.amis.pogamut.sposh.elements.PoshDummyElement<THIS,PARENT>
public abstract class PoshDummyElement<THIS extends PoshElement,PARENT extends PoshElement>
This is class used as intermediate class between PoshElement and DataNodes of POSH elements. Some common functions are implemented here.
Field Summary | |
---|---|
static String |
IDENT_PATTERN
Regular pattern, only text that matches this pattern can be a name of the POSH element. |
Constructor Summary | |
---|---|
PoshDummyElement()
|
Method Summary | ||
---|---|---|
protected
|
getElementId(List<ELEMENT> elements,
ELEMENT element)
Get index of @element in all @elements. |
|
protected static String |
getUnusedName(String template,
List<? extends INamedElement> elements)
Get valid name for new element, but name can't be same as any name used by passed elements. |
|
protected static boolean |
isUsedName(String name,
List<? extends INamedElement> elements)
Is passed name used by one of elements? |
|
protected
|
moveChildInList(List<T> list,
T child,
int newIndex)
Take the @list of elements and one @child of the @list. |
Methods inherited from class cz.cuni.amis.pogamut.sposh.elements.PoshElement |
---|
addElementListener, emitChildDeleted, emitChildMove, emitChildNode, firePropertyChange, getChildDataNodes, getChildId, getChildren, getDataFlavor, getElementListeners, getId, 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 |
Field Detail |
---|
public static final String IDENT_PATTERN
NAME
in the PoshParser.jj
Because of dash (-), not all strings that match this pattern are FQN.
Constructor Detail |
---|
public PoshDummyElement()
Method Detail |
---|
protected <T extends PoshElement> boolean moveChildInList(List<T> list, T child, int newIndex)
NoSuchElementException
, if @newIndex is same as the index
the @child is currently at, don't do anything.
T
- list
- child
- newIndex
- Index
protected static boolean isUsedName(String name, List<? extends INamedElement> elements)
name
- name to be testedelements
- elements againt which the test is done
protected static String getUnusedName(String template, List<? extends INamedElement> elements)
template
- string used as prefix of created nameelements
- elements that must have different name that created name
protected <ELEMENT extends PoshElement & INamedElement> int getElementId(List<ELEMENT> elements, ELEMENT element)
ELEMENT
- Type of elements.elements
- List of elements whereelement
- element for which we are looking for in elements.
IllegalArgumentException
- If element is not among elements.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |