java.lang.Object | +--com.sun.kjava.List
A class representing a list of Objects.
Resembles java.util.Vector
.
Constructor Summary | |
List()
Create a new List, and make it small to start. |
|
List(int initSize)
Create a new List. |
Method Summary | |
void |
append(java.lang.Object obj)
Append an Object to the end, expanding the vector if necessary. |
int |
capacity()
/** What is the total capacity of this List? |
java.lang.Object |
elementAt(int i)
What is the Object at a given index? N.B. |
void |
ensureCapacity(int newCap)
Ensure there's room for some number of entries by any means necessary. |
void |
removeAllElements()
Mark the vector as containing no Objects, and drop all references to the Objects previously contained. |
boolean |
setElementAt(java.lang.Object o,
int pos)
Set the indexed element to an Object. |
int |
size()
What is the size of this List? |
Methods inherited from class java.lang.Object |
equals,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Constructor Detail |
public List()
public List(int initSize)
initSize
- the number of initial elements to allocateMethod Detail |
public java.lang.Object elementAt(int i)
i
- the index of the entrypublic int size()
public void append(java.lang.Object obj)
i
- the value of the new datumpublic void removeAllElements()
public int capacity()
size()
public void ensureCapacity(int newCap)
newCap
- the desired new capacitypublic boolean setElementAt(java.lang.Object o, int pos)
Note: this is a replacement operation - it is not an insertion into the list!
o
- the Object to place in the Listpos
- the index at which to place it.