Class TreeElementChildrenList
java.lang.Object
org.javarosa.core.model.instance.utils.TreeElementChildrenList
- All Implemented Interfaces:
Iterable<TreeElement>
public class TreeElementChildrenList extends Object implements Iterable<TreeElement>
A collection of
TreeElement children. They are stored in an ArrayList.
when all children have the same name and no special (< 0) multiplicities, elements can
be retrieved in constant time.-
Constructor Summary
Constructors Constructor Description TreeElementChildrenList() -
Method Summary
Modifier and Type Method Description voidadd(int index, TreeElement child)Adds a child at the specified indexvoidaddAll(Iterable<TreeElement> childIterable)Adds all of the provided childrenvoidaddInOrder(TreeElement child)voidclear()Removes all childrenTreeElementget(int index)Gets the child at the specified indexList<TreeElement>get(String name)Gets all children with the specified nameTreeElementget(String name, int multiplicity)Gets the child with the specified name and multiplicityintgetCount(String name)Gets a count of all children with the specified namebooleanisEmpty()Iterator<TreeElement>iterator()TreeElementremove(int index)Removes a child at the specified indexvoidremove(String name, int multiplicity)Removes the first child with the given name and multiplicity, if one existsbooleanremove(TreeElement treeElement)Removes a specific childvoidremoveAll(String name)intsize()Returns the number of children
-
Constructor Details
-
TreeElementChildrenList
public TreeElementChildrenList()
-
-
Method Details
-
size
public int size()Returns the number of children -
iterator
- Specified by:
iteratorin interfaceIterable<TreeElement>
-
add
Adds a child at the specified index -
addAll
Adds all of the provided children -
addInOrder
-
get
Gets the child at the specified index -
get
Gets all children with the specified name -
get
Gets the child with the specified name and multiplicity -
getCount
Gets a count of all children with the specified name -
remove
Removes a child at the specified index -
remove
Removes a specific child -
remove
Removes the first child with the given name and multiplicity, if one exists -
removeAll
-
clear
public void clear()Removes all children -
isEmpty
public boolean isEmpty()
-