List of all members.
Detailed Description
This is my implementation of the JDK 1.2 List interface. I wrote this because I want people using 1.1.x to be able to use my apps, but I don't want to use a "synchronized" Vector. I also wanted to get a start in moving my source to JDK 1.2
I use the implementation of the hashCode method that is listed in the JDK 1.2 API, so this List can be compared correctly to actual JDK 1.2 lists using the equals method. Note: This is not a complete implementation yet, None of the methods that take a Collection have been imlplemented.
- Author:
- Keith Visco
- Version:
- Revision:
- 1.2
- Date:
- 2004/05/10 07:51:52
- See also:
- java.util.List
-
java.util.Collection
Constructor & Destructor Documentation
org.exolab.castor.util.List.List |
( |
|
) |
|
org.exolab.castor.util.List.List |
( |
int |
size |
) |
|
Member Function Documentation
boolean org.exolab.castor.util.List.add |
( |
Object |
obj |
) |
|
boolean org.exolab.castor.util.List.add |
( |
int |
index, |
|
|
Object |
obj | |
|
) |
| | throws IndexOutOfBoundsException |
Adds the specified Object to the list at the specified index
- Parameters:
-
| obj | the Object to add to the list |
- Returns:
- true if the Object is added to the list
- Exceptions:
-
| IndexOutOfBoundsException | |
void org.exolab.castor.util.List.clear |
( |
|
) |
|
Object org.exolab.castor.util.List.clone |
( |
|
) |
|
boolean org.exolab.castor.util.List.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.
- Parameters:
-
| obj | the element to search the list for |
- Returns:
- true if specified element is contained in the list
References org.exolab.castor.util.List.indexOf().
boolean org.exolab.castor.util.List.equals |
( |
Object |
obj |
) |
|
Object org.exolab.castor.util.List.get |
( |
int |
index |
) |
throws IndexOutOfBoundsException |
int org.exolab.castor.util.List.hashCode |
( |
|
) |
|
As defined by the JDK 1.2 API spec:
Returns the hash code value for this list. The hash code of a list is defined to be the result of the following calculation:
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
int org.exolab.castor.util.List.indexOf |
( |
Object |
obj |
) |
|
boolean org.exolab.castor.util.List.isEmpty |
( |
|
) |
|
Returns true if there are no elements in the List.
- Returns:
- true if there are no elements in the List.
int org.exolab.castor.util.List.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
- Parameters:
-
| obj | the Object to get the last index for |
Object org.exolab.castor.util.List.remove |
( |
int |
index |
) |
|
boolean org.exolab.castor.util.List.remove |
( |
Object |
obj |
) |
|
Object org.exolab.castor.util.List.set |
( |
int |
index, |
|
|
Object |
element | |
|
) |
| | throws IndexOutOfBoundsException |
Replaces the element at the specified position in this list with the specified element.
- Parameters:
-
| index | the position in the list to place the element at |
| element | the element to add to the list |
- Exceptions:
-
| IndexOutOfBoundsException | |
References org.exolab.castor.util.List.add().
int org.exolab.castor.util.List.size |
( |
|
) |
|
List org.exolab.castor.util.List.subList |
( |
int |
fromIndex, |
|
|
int |
toIndex | |
|
) |
| | |
Object [] org.exolab.castor.util.List.toArray |
( |
Object[] |
dst |
) |
|
Object [] org.exolab.castor.util.List.toArray |
( |
Object[] |
dst, |
|
|
int |
offset | |
|
) |
| | |
Returns an array containing all of the elements in this list in proper sequence.
- Returns:
- the array of elements of this List
Object [] org.exolab.castor.util.List.toArray |
( |
|
) |
|
void org.exolab.castor.util.List.trimToSize |
( |
|
) |
|
Reduces the capacity of the internal buffer to the current size freeing up unused memory.
The documentation for this class was generated from the following file: