T
- type of named elements in the collection.public abstract class NamedElementHolder<T extends NamedElement> extends Object implements Collection<T>
Constructor and Description |
---|
NamedElementHolder() |
Modifier and Type | Method and Description |
---|---|
boolean |
add(T e)
Deprecated.
|
boolean |
addAll(Collection<? extends T> c) |
void |
addElement(T element)
Adds a named element.
|
void |
clear() |
boolean |
contains(Object o) |
boolean |
containsAll(Collection<?> c) |
T |
get(String name)
Returns element by name.
|
Map<String,T> |
getElements()
Returns a copy of elements map only for reading.
|
int |
getIndex(String name)
Returns index of element by name.
|
boolean |
isEmpty() |
Iterator<T> |
iterator() |
boolean |
remove(Object o) |
boolean |
removeAll(Collection<?> c) |
boolean |
retainAll(Collection<?> c) |
int |
size() |
Object[] |
toArray() |
<A> A[] |
toArray(A[] a) |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
equals, hashCode, parallelStream, removeIf, spliterator, stream
public Map<String,T> getElements()
public final void addElement(T element) throws ParseException
element
- element to addParseException
- if an element with the same name already exists.public final T get(String name)
name
- element name (identifier)public final int getIndex(String name)
name
- element name (identifier)public final boolean isEmpty()
isEmpty
in interface Collection<T extends NamedElement>
public final Iterator<T> iterator()
iterator
in interface Iterable<T extends NamedElement>
iterator
in interface Collection<T extends NamedElement>
public final int size()
size
in interface Collection<T extends NamedElement>
public final boolean contains(Object o)
contains
in interface Collection<T extends NamedElement>
public final Object[] toArray()
toArray
in interface Collection<T extends NamedElement>
public final <A> A[] toArray(A[] a)
toArray
in interface Collection<T extends NamedElement>
@Deprecated public final boolean add(T e)
add
in interface Collection<T extends NamedElement>
public final boolean remove(Object o)
remove
in interface Collection<T extends NamedElement>
public final boolean containsAll(Collection<?> c)
containsAll
in interface Collection<T extends NamedElement>
public final boolean addAll(Collection<? extends T> c)
addAll
in interface Collection<T extends NamedElement>
public final boolean removeAll(Collection<?> c)
removeAll
in interface Collection<T extends NamedElement>
public final boolean retainAll(Collection<?> c)
retainAll
in interface Collection<T extends NamedElement>
public final void clear()
clear
in interface Collection<T extends NamedElement>
Copyright © 2021 CURS. All rights reserved.