org.exolab.adaptx.util
public class List extends Object implements Cloneable
See Also: java.util.List java.util.Collection
Constructor Summary | |
---|---|
List()
Creates a new BasicSet with the default Size
| |
List(int size) |
Method Summary | |
---|---|
boolean | add(Object obj)
Adds the specified Object to the list |
boolean | add(int index, Object obj)
Adds the specified Object to the list at the specified index |
void | clear()
Removes all elements from the list
|
Object | clone() |
boolean | contains(Object obj)
Returns true if the specified element is contained in the list.
if the specfied element is null, then if the list contains a null
value, true will be returned. |
boolean | equals(Object obj)
Compares the specified object with this list for equality.
|
Object | get(int index)
Returns the element at the specified position in this list. |
int | hashCode()
As defined by the JDK 1.2 API spec: Returns the hash code value for this list. |
int | indexOf(Object obj)
Returns the index of the first occurrence of the specified element,
or -1 if the element is not contained in the List |
boolean | isEmpty()
Returns true if there are no elements in the List. |
int | lastIndexOf(Object obj)
Returns the index of the last occurrence of the specified element,
or -1 if the element is not contained in the List |
Object | remove(int index)
Removes the element at the specified index from the List |
boolean | remove(Object obj)
Removes the first occurrence of the specified element from the List |
Object | set(int index, Object element)
Replaces the element at the specified position in this list
with the specified element. |
int | size()
Returns the number of elements in the List |
List | subList(int fromIndex, int toIndex)
Returns a new List which contains elements from a given section
of this list. |
Object[] | toArray()
Returns an array containing all of the elements in this list
in proper sequence. |
Object[] | toArray(Object[] dst)
Returns an array containing all of the elements in this list
in proper sequence. |
void | trimToSize()
Reduces the capacity of the internal buffer to the current size
freeing up unused memory.
|
Parameters: obj the Object to add to the list
Returns: true if the Object is added to the list
Parameters: obj the Object to add to the list
Returns: true if the Object is added to the list
Throws: IndexOutOfBoundsException
Parameters: obj the element to search the list for
Returns: true if specified element is contained in the list
Parameters: index the position of the element to return
Throws: IndexOutOfBoundsException
hashCode = 1;
Iterator i = list.iterator();
while (i.hasNext()) {
Object obj = i.next();
hashCode = 31*hashCode + (obj==null ? 0 : obj.hashCode());
}
Returns: the hash code value for this list
Parameters: obj the Object to get the index for
Returns: true if there are no elements in the List.
Parameters: obj the Object to get the last index for
Parameters: index the position in the list tp remove the element from
Returns: the Object that was removed from the list
Parameters: obj the Object to remove from the List
Returns: true if the Object was removed from the list
Parameters: index the position in the list to place the element at element the element to add to the list
Throws: IndexOutOfBoundsException
Returns: the number of elements in the List
Parameters: fromIndex the start index (inclusize) of elements to add to the new list toIndex the end index (exclusive)of the elements to add to the new list
Returns: a new List which contains elements from a given section of this list.
Throws: IndexOutOfBoundsException for invalid index values
Returns: the array of elements of this List
Returns: the array of elements of this List