public class IndexedNodeCollection extends java.util.AbstractCollection<ConfigNode> implements NodeCollection
| Constructor and Description |
|---|
IndexedNodeCollection(ConfigBranch owner) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(ConfigNode item)
Attempts to introduce a new child to this collection.
|
boolean |
add(ConfigNode item,
boolean overwrite)
Attempts to introduce a new child to this collection.
|
boolean |
contains(java.lang.Object o) |
ConfigNode |
getByName(java.lang.String name)
Tries to find a child in this collection by name.
|
java.util.Iterator<ConfigNode> |
iterator() |
boolean |
remove(java.lang.Object child)
Removes a child from this collection.
|
ConfigNode |
removeByName(java.lang.String name)
Attempts to remove an item from this collection by name.
|
int |
size() |
java.util.Spliterator<ConfigNode> |
spliterator() |
addAll, clear, containsAll, isEmpty, removeAll, retainAll, toArray, toArray, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitpublic IndexedNodeCollection(@Nullable
ConfigBranch owner)
@Nonnull public java.util.Iterator<ConfigNode> iterator()
iterator in interface java.lang.Iterable<ConfigNode>iterator in interface java.util.Collection<ConfigNode>iterator in class java.util.AbstractCollection<ConfigNode>public java.util.Spliterator<ConfigNode> spliterator()
spliterator in interface java.lang.Iterable<ConfigNode>spliterator in interface java.util.Collection<ConfigNode>public boolean add(ConfigNode item) throws DuplicateChildException
NodeCollection This method behaves as if add(node, false).
add in interface java.util.Collection<ConfigNode>add in interface NodeCollectionadd in class java.util.AbstractCollection<ConfigNode>item - The child to addtrue (as specified by Collection.add(E))DuplicateChildException - if there was already a child by the same namepublic boolean add(ConfigNode item, boolean overwrite) throws DuplicateChildException
NodeCollection If this method returns normally, the child will be attached
to this collection's owner.
add in interface NodeCollectionitem - The child to addoverwrite - whether existing items with the same name should be overwrittentrue (as specified by Collection.add(E))DuplicateChildException - if there exists a child by the same name that was not overwrittenConfigNode.attachTo(ConfigBranch)public boolean contains(@Nullable
java.lang.Object o)
contains in interface java.util.Collection<ConfigNode>contains in class java.util.AbstractCollection<ConfigNode>public boolean remove(@Nullable
java.lang.Object child)
NodeCollection When this method returns, the child will be detached from
this collection's owner. If the given object is not contained within this
collection, this method returns false with no side effects.
remove in interface java.util.Collection<ConfigNode>remove in interface NodeCollectionremove in class java.util.AbstractCollection<ConfigNode>child - the child to removetrue if a node was detached as a result of this callConfigNode.detach()public int size()
size in interface java.util.Collection<ConfigNode>size in class java.util.AbstractCollection<ConfigNode>public ConfigNode getByName(java.lang.String name)
NodeCollectiongetByName in interface NodeCollectionname - The name of the child to look fornull@Nullable public ConfigNode removeByName(java.lang.String name)
NodeCollectionremoveByName in interface NodeCollectionname - the name of the child that should be removednull