public abstract class AbstractNamedObjects<E extends NamedObject> extends java.lang.Object implements NamedObjects<E>
Modifier | Constructor and Description |
---|---|
protected |
AbstractNamedObjects(java.lang.String name)
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
boolean |
containsKey(@NotNull java.lang.String name)
Check whether an object is defined.
|
E |
get(@NotNull java.lang.String objectName)
Gets a AbstractNamedObject.
|
@NotNull java.lang.String |
getName()
Returns the tree name.
|
@NotNull NamedTreeNode<E> |
getTreeRoot()
Get the object tree root.
|
java.util.Iterator<E> |
iterator()
NamedObjects are iterated in Unicode (=case sensitive
ASCII) order.
|
protected void |
put(E object)
Stores an AbstractNamedObject.
|
int |
size()
Get the number of objects.
|
protected AbstractNamedObjects(java.lang.String name)
name
- the localized name of the object type, e.g. used in dialogs@NotNull public @NotNull NamedTreeNode<E> getTreeRoot()
NamedObjects
getTreeRoot
in interface NamedObjects<E extends NamedObject>
@NotNull public @NotNull java.lang.String getName()
NamedObjects
getName
in interface NamedObjects<E extends NamedObject>
protected void put(@NotNull E object) throws IllegalNamedObjectException
object
- AbstractNamedObject to storeIllegalNamedObjectException
- if the named object cannot be addedpublic int size()
NamedObjects
size
in interface NamedObjects<E extends NamedObject>
@Nullable public E get(@NotNull @NotNull java.lang.String objectName)
NamedObjects
get
in interface NamedObjects<E extends NamedObject>
objectName
- name of objectobjectName
or null
if none
foundpublic boolean containsKey(@NotNull @NotNull java.lang.String name)
NamedObjects
containsKey
in interface NamedObjects<E extends NamedObject>
name
- object name to look fortrue
if an object with that name is defined, otherwise
false
public java.util.Iterator<E> iterator()
NamedObjects
iterator
in interface java.lang.Iterable<E extends NamedObject>
iterator
in interface NamedObjects<E extends NamedObject>