net.sf.magicproject.tools
Class IntegerList

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractList<E>
          extended by java.util.ArrayList<java.lang.Integer>
              extended by net.sf.magicproject.tools.IntegerList
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.lang.Iterable<java.lang.Integer>, java.util.Collection<java.lang.Integer>, java.util.List<java.lang.Integer>, java.util.RandomAccess

public class IntegerList
extends java.util.ArrayList<java.lang.Integer>

Since:
0.82
Author:
Fabrice Daugan
See Also:
Serialized Form

Constructor Summary
IntegerList()
          Create a new instance of this class.
 
Method Summary
 void addInt(int value)
          Appends the specified element to the end of this list.
 void addInt(int index, int value)
          Inserts the specified element at the specified position in this list.
 IntegerList clone()
          Returns a shallow copy of this ArrayList instance.
 int getFirstInt()
          Return the first int of the list.
 int getInt(int index)
          Returns the element at the specified position in this list.
 int getLastInt()
          Return the last int of the list.
 int removeFirstInt()
          Removes the element at the first position in this list.
 int removeInt(int index)
          Removes the element at the specified position in this list.
 int removeLastInt()
          Removes the element at the last position in this list.
 
Methods inherited from class java.util.ArrayList
add, add, addAll, addAll, clear, contains, ensureCapacity, get, indexOf, isEmpty, lastIndexOf, remove, remove, set, size, toArray, toArray, trimToSize
 
Methods inherited from class java.util.AbstractList
equals, hashCode, iterator, listIterator, listIterator, subList
 
Methods inherited from class java.util.AbstractCollection
containsAll, removeAll, retainAll, toString
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
containsAll, equals, hashCode, iterator, listIterator, listIterator, removeAll, retainAll, subList
 

Constructor Detail

IntegerList

public IntegerList()
Create a new instance of this class.

Method Detail

clone

public IntegerList clone()
Returns a shallow copy of this ArrayList instance. (The elements themselves are not copied.)

Overrides:
clone in class java.util.ArrayList<java.lang.Integer>
Returns:
a clone of this ArrayList instance.

getLastInt

public int getLastInt()
Return the last int of the list.

Returns:
the last int of the list.

getFirstInt

public int getFirstInt()
Return the first int of the list.

Returns:
the first int of the list.

getInt

public int getInt(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.

addInt

public void addInt(int value)
Appends the specified element to the end of this list.

Parameters:
value - element to be appended to this list.

addInt

public void addInt(int index,
                   int value)
Inserts the specified element at the specified position in this list. Shifts the element currently at that position (if any) and any subsequent elements to the right (adds one to their indices).

Parameters:
index - index at which the specified element is to be inserted.
value - element to be inserted.

removeLastInt

public int removeLastInt()
Removes the element at the last 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.

removeFirstInt

public int removeFirstInt()
Removes the element at the first 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.

removeInt

public int removeInt(int index)
Removes the element at the specified position in this list. Shifts any subsequent elements to the left (subtracts one from their indices).

Parameters:
index - the index of the element to removed.
Returns:
the element that was removed from the list.


Copyright © 2003-2007 Magic-Project. All Rights Reserved.