public class TreeElementChildrenList extends Object implements Iterable<TreeElement>
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 and Description |
|---|
TreeElementChildrenList() |
| Modifier and Type | Method and Description |
|---|---|
void |
add(int index,
TreeElement child)
Adds a child at the specified index
|
void |
addAll(Iterable<TreeElement> childIterable)
Adds all of the provided children
|
void |
addInOrder(TreeElement child) |
void |
clear()
Removes all children
|
TreeElement |
get(int index)
Gets the child at the specified index
|
List<TreeElement> |
get(String name)
Gets all children with the specified name
|
TreeElement |
get(String name,
int multiplicity)
Gets the child with the specified name and multiplicity
|
int |
getCount(String name)
Gets a count of all children with the specified name
|
boolean |
isEmpty() |
Iterator<TreeElement> |
iterator() |
TreeElement |
remove(int index)
Removes a child at the specified index
|
void |
remove(String name,
int multiplicity)
Removes the first child with the given name and multiplicity, if one exists
|
boolean |
remove(TreeElement treeElement)
Removes a specific child
|
void |
removeAll(String name) |
int |
size()
Returns the number of children
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitforEach, spliteratorpublic int size()
public Iterator<TreeElement> iterator()
iterator in interface Iterable<TreeElement>public void add(int index,
TreeElement child)
public void addAll(Iterable<TreeElement> childIterable)
public void addInOrder(TreeElement child)
public TreeElement get(int index)
public List<TreeElement> get(String name)
public TreeElement get(String name, int multiplicity)
public int getCount(String name)
public TreeElement remove(int index)
public boolean remove(TreeElement treeElement)
public void remove(String name, int multiplicity)
public void removeAll(String name)
public void clear()
public boolean isEmpty()
Copyright © 2022. All rights reserved.