jade.util.leap
Interface List

All Known Implementing Classes:
ArrayList, LinkedList

public interface List
extends Collection

This class represents the LEAP version of a "List"

Version:
1.0, 23/10/00
Author:
Nicolas Lhuillier
See Also:
(J2SE)

Method Summary
 void add(int index, java.lang.Object o)
          Inserts the specified element at the specified position in this list
 void clear()
          Removes all of the elements from this list (optional operation).
 boolean contains(java.lang.Object o)
          Returns true if this list contains the specified element.
 java.lang.Object get(int index)
          Returns the element at the specified position in this list.
 int indexOf(java.lang.Object o)
          Returns the index in this list of the first occurrence of the specified element, or -1 if this list does not contain this element.
 java.lang.Object remove(int index)
          Removes the element at the specified position in this list.
 
Methods inherited from interface jade.util.leap.Collection
add, isEmpty, iterator, remove, size, toArray
 

Method Detail

add

public void add(int index,
                java.lang.Object o)
Inserts the specified element at the specified position in this list

clear

public void clear()
Removes all of the elements from this list (optional operation). This list will be empty after this call returns.

contains

public boolean contains(java.lang.Object o)
Returns true if this list contains the specified element.
Parameters:
o - element whose presence in this list is to be tested.
Returns:
true if this list contains the specified element.

get

public java.lang.Object get(int index)
Returns the element at the specified position in this list.
Parameters:
index - index of element to return.
Returns:
the element at the specified position in this list.
Throws:
java.lang.IndexOutOfBoundsException - if the index is out of range (index < 0 || index >= size()).

indexOf

public int indexOf(java.lang.Object o)
Returns the index in this list of the first occurrence of the specified element, or -1 if this list does not contain this element.
Parameters:
o - element to search for.
Returns:
the index in this list of the first occurrence of the specified element, or -1 if this list does not contain this element.

remove

public java.lang.Object remove(int index)
Removes the element at the specified position in this list. Shifts any subsequent elements to the left (subtracts one from their indices). Returns the element that was removed from the list.
Parameters:
index - the index of the element to removed.
Returns:
the element previously at the specified position.
Throws:
java.lang.IndexOutOfBoundsException - if the index is out of range (index < 0 || index >= size()).