Package net.sf.gridarta.model.data
Class AbstractNamedObjects<E extends NamedObject>
- java.lang.Object
-
- net.sf.gridarta.model.data.AbstractNamedObjects<E>
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Iterable<E>,NamedObjects<E>
- Direct Known Subclasses:
AbstractAnimationObjects,AbstractFaceObjects
public abstract class AbstractNamedObjects<E extends NamedObject> extends java.lang.Object implements NamedObjects<E>
This class manages NamedObjects, managing their tree as well as providing a method for showing a dialog for browsing their tree and selecting one from it. NamedObjects are iterated in Unicode (=ASCII) order.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractNamedObjects(java.lang.String name)Creates a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancontainsKey(@NotNull java.lang.String name)Check whether an object is defined.Eget(@NotNull java.lang.String objectName)Gets a AbstractNamedObject.@NotNull java.lang.StringgetName()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 voidput(E object)Stores an AbstractNamedObject.intsize()Get the number of objects.
-
-
-
Method Detail
-
getTreeRoot
@NotNull public @NotNull NamedTreeNode<E> getTreeRoot()
Description copied from interface:NamedObjectsGet the object tree root.- Specified by:
getTreeRootin interfaceNamedObjects<E extends NamedObject>- Returns:
- object tree root
-
getName
@NotNull public @NotNull java.lang.String getName()
Description copied from interface:NamedObjectsReturns the tree name.- Specified by:
getNamein interfaceNamedObjects<E extends NamedObject>- Returns:
- the tree name
-
put
protected void put(@NotNull E object) throws IllegalNamedObjectExceptionStores an AbstractNamedObject.- Parameters:
object- AbstractNamedObject to store- Throws:
IllegalNamedObjectException- if the named object cannot be added
-
size
public int size()
Description copied from interface:NamedObjectsGet the number of objects.- Specified by:
sizein interfaceNamedObjects<E extends NamedObject>- Returns:
- object count
-
get
@Nullable public E get(@NotNull @NotNull java.lang.String objectName)
Description copied from interface:NamedObjectsGets a AbstractNamedObject.- Specified by:
getin interfaceNamedObjects<E extends NamedObject>- Parameters:
objectName- name of object- Returns:
- named object for name
objectNameornullif none found
-
containsKey
public boolean containsKey(@NotNull @NotNull java.lang.String name)Description copied from interface:NamedObjectsCheck whether an object is defined.- Specified by:
containsKeyin interfaceNamedObjects<E extends NamedObject>- Parameters:
name- object name to look for- Returns:
trueif an object with that name is defined, otherwisefalse
-
iterator
public java.util.Iterator<E> iterator()
Description copied from interface:NamedObjectsNamedObjects are iterated in Unicode (=case sensitive ASCII) order.- Specified by:
iteratorin interfacejava.lang.Iterable<E extends NamedObject>- Specified by:
iteratorin interfaceNamedObjects<E extends NamedObject>
-
-