jade.util.leap
Class ArrayList

java.lang.Object
  |
  +--jade.util.leap.ArrayList

public class ArrayList
extends java.lang.Object
implements List, Serializable

This class represents the J2SE version of a "ArrayList" to be used in LEAP.

Version:
1.0, 29/09/00
Author:
Nicolas Lhuillier
See Also:
ArrayList, Serialized Form

Constructor Summary
ArrayList()
          Default Constructor, creates an empty List
ArrayList(java.util.ArrayList toBeHiddenList)
          Constructs an ArrayList from a java.util.ArrayList.
ArrayList(int size)
          Constructor specifying list size
 
Method Summary
 void add(int index, java.lang.Object o)
          Inserts the specified element at the specified position in this list
 boolean add(java.lang.Object o)
          Adds an element.
 void clear()
          Removes all of the elements from this list (optional operation).
 java.lang.Object clone()
          Method declaration
 boolean contains(java.lang.Object o)
          Returns true if this list contains the specified element.
 void fromList(java.util.List l)
           
 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.
 boolean isEmpty()
          Checks if the collection contains elements.
 Iterator iterator()
          Returns an iterator over the elements in this collection.
 java.lang.Object remove(int index)
          Removes the element at the specified position in this list.
 boolean remove(java.lang.Object o)
          Removes one instance of the specified element.
 int size()
          Returns the number of elements in this collection.
 java.lang.Object[] toArray()
          Returns an array containing all of the elements in this collection.
 java.util.List toList()
          Method declaration
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ArrayList

public ArrayList()
Default Constructor, creates an empty List

ArrayList

public ArrayList(int size)
Constructor specifying list size

ArrayList

public ArrayList(java.util.ArrayList toBeHiddenList)
Constructs an ArrayList from a java.util.ArrayList.
Method Detail

clear

public void clear()
Description copied from interface: List
Removes all of the elements from this list (optional operation). This list will be empty after this call returns.
Specified by:
clear in interface List
See Also:
interface

contains

public boolean contains(java.lang.Object o)
Description copied from interface: List
Returns true if this list contains the specified element.
Specified by:
contains in interface List
See Also:
interface

get

public java.lang.Object get(int index)
Description copied from interface: List
Returns the element at the specified position in this list.
Specified by:
get in interface List
See Also:
interface

indexOf

public int indexOf(java.lang.Object o)
Description copied from interface: List
Returns the index in this list of the first occurrence of the specified element, or -1 if this list does not contain this element.
Specified by:
indexOf in interface List
See Also:
interface

remove

public java.lang.Object remove(int index)
Description copied from interface: List
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.
Specified by:
remove in interface List
See Also:
interface

add

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

add

public boolean add(java.lang.Object o)
Description copied from interface: Collection
Adds an element.
See Also:
interface

isEmpty

public boolean isEmpty()
Description copied from interface: Collection
Checks if the collection contains elements.
See Also:
interface

remove

public boolean remove(java.lang.Object o)
Description copied from interface: Collection
Removes one instance of the specified element.
See Also:
interface

iterator

public Iterator iterator()
Description copied from interface: Collection
Returns an iterator over the elements in this collection. There are no guarantees concerning the order in which the elements are returned.
See Also:
interface

toArray

public java.lang.Object[] toArray()
Description copied from interface: Collection
Returns an array containing all of the elements in this collection.
See Also:
interface

size

public int size()
Description copied from interface: Collection
Returns the number of elements in this collection.
See Also:
interface

clone

public java.lang.Object clone()
Method declaration
Overrides:
clone in class java.lang.Object
Returns:
java.lang.Object

toList

public java.util.List toList()
Method declaration
Returns:
java.util.List

fromList

public void fromList(java.util.List l)