Save This Page
Home » poi-src-3.2-FINAL-20081019 » org.apache » poi » util » [javadoc | source]
org.apache.poi.util
public class: IntList [javadoc | source]
java.lang.Object
   org.apache.poi.util.IntList
A List of int's; as full an implementation of the java.util.List interface as possible, with an eye toward minimal creation of objects the mimicry of List is as follows: the mimicry is not perfect, however:
Constructor:
 public IntList() 
 public IntList(int initialCapacity) 
 public IntList(IntList list) 
    create a copy of an existing IntList
    Parameters:
    list - the existing IntList
 public IntList(int initialCapacity,
    int fillvalue) 
Method from org.apache.poi.util.IntList Summary:
add,   add,   addAll,   addAll,   clear,   contains,   containsAll,   equals,   get,   hashCode,   indexOf,   isEmpty,   lastIndexOf,   remove,   removeAll,   removeValue,   retainAll,   set,   size,   toArray,   toArray
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.poi.util.IntList Detail:
 public boolean add(int value) 
    Appends the specified element to the end of this list
 public  void add(int index,
    int value) 
    add the specfied value at the specified index
 public boolean addAll(IntList c) 
    Appends all of the elements in the specified collection to the end of this list, in the order that they are returned by the specified collection's iterator. The behavior of this operation is unspecified if the specified collection is modified while the operation is in progress. (Note that this will occur if the specified collection is this list, and it's nonempty.)
 public boolean addAll(int index,
    IntList c) 
    Inserts all of the elements in the specified collection into this list at the specified position. Shifts the element currently at that position (if any) and any subsequent elements to the right (increases their indices). The new elements will appear in this list in the order that they are returned by the specified collection's iterator. The behavior of this operation is unspecified if the specified collection is modified while the operation is in progress. (Note that this will occur if the specified collection is this list, and it's nonempty.)
 public  void clear() 
    Removes all of the elements from this list. This list will be empty after this call returns (unless it throws an exception).
 public boolean contains(int o) 
    Returns true if this list contains the specified element. More formally, returns true if and only if this list contains at least one element e such that o == e
 public boolean containsAll(IntList c) 
    Returns true if this list contains all of the elements of the specified collection.
 public boolean equals(Object o) 
    Compares the specified object with this list for equality. Returns true if and only if the specified object is also a list, both lists have the same size, and all corresponding pairs of elements in the two lists are equal. (Two elements e1 and e2 are equal if e1 == e2.) In other words, two lists are defined to be equal if they contain the same elements in the same order. This definition ensures that the equals method works properly across different implementations of the List interface.
 public int get(int index) 
    Returns the element at the specified position in this list.
 public int hashCode() 
    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()); } This ensures that list1.equals(list2) implies that list1.hashCode()==list2.hashCode() for any two lists, list1 and list2, as required by the general contract of Object.hashCode.
 public int indexOf(int 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. More formally, returns the lowest index i such that (o == get(i)), or -1 if there is no such index.
 public boolean isEmpty() 
    Returns true if this list contains no elements.
 public int lastIndexOf(int o) 
    Returns the index in this list of the last occurrence of the specified element, or -1 if this list does not contain this element. More formally, returns the highest index i such that (o == get(i)), or -1 if there is no such index.
 public int 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.
 public boolean removeAll(IntList c) 
    Removes from this list all the elements that are contained in the specified collection
 public boolean removeValue(int o) 
    Removes the first occurrence in this list of the specified element (optional operation). If this list does not contain the element, it is unchanged. More formally, removes the element with the lowest index i such that (o.equals(get(i))) (if such an element exists).
 public boolean retainAll(IntList c) 
    Retains only the elements in this list that are contained in the specified collection. In other words, removes from this list all the elements that are not contained in the specified collection.
 public int set(int index,
    int element) 
    Replaces the element at the specified position in this list with the specified element
 public int size() 
    Returns the number of elements in this list. If this list contains more than Integer.MAX_VALUE elements, returns Integer.MAX_VALUE.
 public int[] toArray() 
    Returns an array containing all of the elements in this list in proper sequence. Obeys the general contract of the Collection.toArray method.
 public int[] toArray(int[] a) 
    Returns an array containing all of the elements in this list in proper sequence. Obeys the general contract of the Collection.toArray(Object[]) method.