|
OpMath | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
The interface required for a column of a DisplayTable.
An object that implements the ComparableList interface can act as a column within a
DisplayTable. Note that column objects are not required to support CREATE, UPDATE
or DELETE operations.
Copyright: (c) 2002 The Open Math Company Limited
The Terms of Distribution of this software are stipulated in the javadoc Overview for this project.
| Method Summary | |
boolean |
add(Comparable element)
Appends the specified element to the end of this ComparableList. |
void |
clear()
Removes all of the elements from this ComparableList. |
Enumeration |
elements()
Returns an enumeration of the components of this ComparableList. |
Object |
get(int index)
Returns the element at the specified position in this ComparableList. |
int |
indexOf(Object element)
Searches for the first occurence of the given argument, testing for equality using the equals(Object) method. |
Comparable |
set(int index,
Comparable element)
Replaces the element at the specified position in this list with the specified element. |
int |
size()
Returns the number of elements in this list. |
String |
toString()
Returns a string representation of the implementing object, containing a String
representation of each element. |
| Method Detail |
public Enumeration elements()
ComparableList. The returned
Enumeration object will generate all items in this list.
public void clear()
ComparableList. This list will be empty after
this call returns.
NOTE: All implementations of ComparableList must support the clear() method.
However, implementations are free to interpret the clear function in any way, and may in fact do
nothing.
public boolean add(Comparable element)
throws UnsupportedOperationException
ComparableList.
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.
element - the Comparable to be added.
UnsupportedOperationException
public Comparable set(int index,
Comparable element)
throws UnsupportedOperationException
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.
index - the int index of element to replace.element - the Comparable element to be stored at the specified position.
UnsupportedOperationException - if the set(int,Comparable)
method is not supported by this list.
public Object get(int index)
throws IndexOutOfBoundsException
ComparableList.
index - the int index of element.
Object at the specified position in this list.
IndexOutOfBoundsException - if the index is out of
range (index < 0 || index >= size()).public int indexOf(Object element)
equals(Object) method.
elem.equals(elementData[k]) is true;
returns -1 if the object is not found.public int size()
Integer.MAX_VALUE elements, returns Integer.MAX_VALUE.
public String toString()
String
representation of each element.
toString in class Object
|
OpMath | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||