public class IndexedNodeCollection extends 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(Object o) |
ConfigNode |
getByName(String name)
Tries to find a child in this collection by name.
|
Iterator<ConfigNode> |
iterator() |
boolean |
remove(Object child)
Removes a child from this collection.
|
ConfigNode |
removeByName(String name)
Attempts to remove an item from this collection by name.
|
int |
size() |
Spliterator<ConfigNode> |
spliterator() |
addAll, clear, containsAll, isEmpty, removeAll, retainAll, toArray, toArray, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitaddAll, clear, containsAll, equals, hashCode, isEmpty, parallelStream, removeAll, removeIf, retainAll, stream, toArray, toArraypublic IndexedNodeCollection(@Nullable ConfigBranch owner)
@Nonnull public Iterator<ConfigNode> iterator()
iterator in interface Iterable<ConfigNode>iterator in interface Collection<ConfigNode>iterator in class AbstractCollection<ConfigNode>public Spliterator<ConfigNode> spliterator()
spliterator in interface Iterable<ConfigNode>spliterator in interface Collection<ConfigNode>public boolean add(ConfigNode item) throws DuplicateChildException
NodeCollectionThis method behaves as if add(node, false).
add in interface NodeCollectionadd in interface Collection<ConfigNode>add in class 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
NodeCollectionIf 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 Object o)
contains in interface Collection<ConfigNode>contains in class AbstractCollection<ConfigNode>public boolean remove(@Nullable Object child)
NodeCollectionWhen 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 NodeCollectionremove in interface Collection<ConfigNode>remove in class 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 Collection<ConfigNode>size in class AbstractCollection<ConfigNode>public ConfigNode getByName(String name)
NodeCollectiongetByName in interface NodeCollectionname - The name of the child to look fornull@Nullable public ConfigNode removeByName(String name)
NodeCollectionremoveByName in interface NodeCollectionname - the name of the child that should be removednull