|
OpMath | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--java.util.AbstractCollection
|
+--java.util.AbstractList
|
+--java.util.Vector
|
+--com.opmath.util.datastruct.ComparableVector
An object which can serve as a DisplayTable column, implemented by extending
java.util.Vector.
ComparableVector implements the ComparableList interface, thus it provides a storage
structure for columns of a DisplayTable with exactly the access methods required by the
containing class.
This class is the simplest and most literal implementation of the ComparableList interface, in
that it uses its own, explicity-declared local storage for the column data. Other implementations of the
ComparableList interface can do other things ...
Copyright: (c) 2002 The Open Math Company Limited
The Terms of Distribution of this software are stipulated in the javadoc Overview for this project.
| Fields inherited from class java.util.Vector |
capacityIncrement, elementCount, elementData |
| Fields inherited from class java.util.AbstractList |
modCount |
| Constructor Summary | |
ComparableVector()
Constructs an empty ComparableVector so that its internal data array has size 10 and its
standard capacity increment is zero. |
|
ComparableVector(Collection c)
Constructs a ComparableVector containing the elements of the specified collection, in the
order they are returned by the collection's iterator. |
|
ComparableVector(int initialCapacity)
Constructs an empty ComparableVector with the specified initial capacity and with its
capacity increment equal to zero. |
|
ComparableVector(int initialCapacity,
int capacityIncrement)
Constructs an empty ComparableVector with the specified initial capacity and capacity increment. |
|
| Method Summary | |
boolean |
add(Comparable element)
Appends the specified element to the end of this list. |
Comparable |
set(int index,
Comparable element)
Replaces the element at the specified position in this ComparableVector with the
specified element. |
String |
toString()
Returns a new String, detailing the contents of this ComparableVector instance. |
| Methods inherited from class java.util.Vector |
add, add, addAll, addAll, addElement, capacity, clear, clone, contains, containsAll, copyInto, elementAt, elements, ensureCapacity, equals, firstElement, get, hashCode, indexOf, indexOf, insertElementAt, isEmpty, lastElement, lastIndexOf, lastIndexOf, remove, remove, removeAll, removeAllElements, removeElement, removeElementAt, removeRange, retainAll, set, setElementAt, setSize, size, subList, toArray, toArray, trimToSize |
| Methods inherited from class java.util.AbstractList |
iterator, listIterator, listIterator |
| Methods inherited from class java.lang.Object |
|
| Methods inherited from interface com.opmath.util.datastruct.ComparableList |
clear, elements, get, indexOf, size |
| Methods inherited from interface java.util.List |
iterator, listIterator, listIterator |
| Constructor Detail |
public ComparableVector()
ComparableVector so that its internal data array has size 10 and its
standard capacity increment is zero.
public ComparableVector(Collection c)
ComparableVector containing the elements of the specified collection, in the
order they are returned by the collection's iterator.
c - a Collection used to populate the ComparableVector.public ComparableVector(int initialCapacity)
ComparableVector with the specified initial capacity and with its
capacity increment equal to zero.
initialCapacity - the initial capacity of the ComparableVector.
public ComparableVector(int initialCapacity,
int capacityIncrement)
ComparableVector with the specified initial capacity and capacity increment.
initialCapacity - the initial capacity of the ComparableVector.capacityIncrement - the amount by which the capacity is increased when the
ComparableVector overflows.| Method Detail |
public Comparable set(int index,
Comparable element)
throws ArrayIndexOutOfBoundsException
ComparableVector with the
specified element.
set in interface ComparableListindex - the int index of element to replace.element - the Comparable element to be stored at the specified position.Comparable element previously stored at this location.ArrayIndexOutOfBoundsException - an exception thrown if the index is out of
range (index < 0 || index >= size()).public boolean add(Comparable element)
Lists may place limitations on what elements may be added to this list. In particular, some lists will refuse to add null elements, and others will impose restrictions on the type of elements that may be added.
add in interface ComparableListelement - the Comparable to be added.public String toString()
String, detailing the contents of this ComparableVector instance.
toString in interface ComparableListtoString in class VectorString.
|
OpMath | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||