All Packages Class Hierarchy This Package Previous Next Index
java.lang.Object | +----openstar.util.TypedList
true
if and only if the given object is also a
TypedList
(no matter which subclass thereof), and
both lists contain the same number of objects, and the
application of the equals
method of all elements returns
true
.
protected ClassTest classTest
protected Vector vector
public TypedList(String requiredType, boolean polymorphic)
true
indicates that objects belongig
to subclasses of the specified type may also be stored in the list.
public TypedList(String requiredType, boolean polymorphic, int initialCapacity)
true
indicates that objects belongig
to subclasses of the specified type may also be stored in the list.
Vector
that is used to store the elements of the list.
public synchronized Object clone()
The elements of the list are not cloned, i.e. only the references to the objects are copied.
public int size()
public int length()
public boolean isEmpty()
public int indexOf(Object elem, int startIndex) throws IllegalArgumentException
public Object elementAt(int index) throws ArrayIndexOutOfBoundsException
public Object getAt(int index)
public void setElementAt(Object elem, int index) throws IllegalArgumentException, ArrayIndexOutOfBoundsException
public void removeElementAt(int index) throws ArrayIndexOutOfBoundsException
public void removeElement(Object elem)
public void insertElementAt(Object elem, int index) throws IllegalArgumentException, ArrayIndexOutOfBoundsException
public void addElement(Object elem) throws IllegalArgumentException
public void add(TypedList a) throws IllegalArgumentException
public void removeAllElements()
public String toString()
protected void test(Object object) throws IllegalArgumentException
If the object has an invalid type, an IllegalArgumentException
is thrown. Otherwise, nothing happens.
public boolean equals(Object obj)
true
if and only if the given object is also a
TypedList
(no matter which subclass thereof), and
both lists contain the same number of objects, and the
application of the equals
method of all elements returns
true
.
Note 1: the above definition implies that two TypedList
objects can be equal even if they support two types that are not related
to each other in any way, as long as the actual objects in the list
are related to both types through an implements
or
extends
clause.
Note 2: the implementation of the equals
method should,
according to the Java specs, always be symetric. Thus, the
information which equals
method for a given pair of
list elements is actually used should be irrelevant.
public String getElemClassName()
All elements are guaranteed to be either of this exact type, or (
if isPolymorphic()
returns true
) to
be of this type or a subclass thereof.
public boolean isPolymorphic()
All Packages Class Hierarchy This Package Previous Next Index