Package eu.europa.ted.efx.model
Class ContentBlockStack
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractList<E>
-
- java.util.Vector<E>
-
- java.util.Stack<ContentBlock>
-
- eu.europa.ted.efx.model.ContentBlockStack
-
- All Implemented Interfaces:
Serializable,Cloneable,Iterable<ContentBlock>,Collection<ContentBlock>,List<ContentBlock>,RandomAccess
public class ContentBlockStack extends Stack<ContentBlock>
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class java.util.Vector
capacityIncrement, elementCount, elementData
-
Fields inherited from class java.util.AbstractList
modCount
-
-
Constructor Summary
Constructors Constructor Description ContentBlockStack()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ContentBlockblockAtLevel(int indentationLevel)Finds the block in the stack that has the given indentation level.intcurrentIndentationLevel()Returns the indentation level of the block at the top of the stack or zero if the stack is empty.voidpushChild(int number, Markup content, Context context)Adds a new child block to the top of the stack.voidpushSibling(int number, Markup content, Context context)Removes the block at the top of the stack and replaces it by a new sibling block.-
Methods inherited from class java.util.Vector
add, add, addAll, addAll, addElement, capacity, clear, clone, contains, containsAll, copyInto, elementAt, elements, ensureCapacity, equals, firstElement, forEach, get, hashCode, indexOf, indexOf, insertElementAt, isEmpty, iterator, lastElement, lastIndexOf, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeAllElements, removeElement, removeElementAt, removeIf, removeRange, replaceAll, retainAll, set, setElementAt, setSize, size, sort, spliterator, subList, toArray, toArray, toString, trimToSize
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.Collection
parallelStream, stream, toArray
-
-
-
-
Method Detail
-
pushChild
public void pushChild(int number, Markup content, Context context)Adds a new child block to the top of the stack. When the child is later removed, its parent will return to the top of the stack again.
-
pushSibling
public void pushSibling(int number, Markup content, Context context)Removes the block at the top of the stack and replaces it by a new sibling block. When the last sibling is later removed, their parent block will return to the top of the stack again.
-
blockAtLevel
public ContentBlock blockAtLevel(int indentationLevel)
Finds the block in the stack that has the given indentation level. Works from the top of the stack to the bottom.
-
currentIndentationLevel
public int currentIndentationLevel()
Returns the indentation level of the block at the top of the stack or zero if the stack is empty. Works from the bottom of the stack to the top.
-
-