Save This Page
Home » mahout-collections-1.0-src » org.apache.mahout.math.list » [javadoc | source]
org.apache.mahout.math.list
public class: ObjectArrayList [javadoc | source]
java.lang.Object
   org.apache.mahout.math.PersistentObject
      org.apache.mahout.math.list.AbstractList
         org.apache.mahout.math.list.AbstractObjectList<T>
            org.apache.mahout.math.list.ObjectArrayList

All Implemented Interfaces:
    Cloneable, Serializable

Resizable list holding ${valueType} elements; implemented with arrays.
Constructor:
 public ObjectArrayList() 
 public ObjectArrayList(T[] elements) 
 public ObjectArrayList(int initialCapacity) 
Method from org.apache.mahout.math.list.ObjectArrayList Summary:
add,   beforeInsert,   beforeInsertDummies,   clone,   copy,   elements,   elements,   ensureCapacity,   equals,   forEach,   get,   getQuick,   indexOfFromTo,   lastIndexOfFromTo,   mergeSortFromTo,   partFromTo,   quickSortFromTo,   removeFromTo,   replaceFromWith,   reverse,   set,   setQuick,   size,   trimToSize
Methods from org.apache.mahout.math.list.AbstractObjectList:
addAllOf,   beforeInsertAllOf,   replaceFromWith
Methods from org.apache.mahout.math.list.AbstractList:
beforeInsertDummies,   checkRange,   checkRangeFromTo,   clear,   isEmpty,   mergeSort,   mergeSortFromTo,   quickSort,   quickSortFromTo,   remove,   removeFromTo,   reverse,   setSize,   size,   sort,   sortFromTo,   trimToSize
Methods from org.apache.mahout.math.PersistentObject:
clone
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.mahout.math.list.ObjectArrayList Detail:
 public  void add(T element) 
    Appends the specified element to the end of this list.
 public  void beforeInsert(int index,
    T element) 
    Inserts the specified element before the specified position into the receiver. Shifts the element currently at that position (if any) and any subsequent elements to the right.
 protected  void beforeInsertDummies(int index,
    int length) 
 public Object clone() 
    Returns a deep copy of the receiver.
 public ObjectArrayList<T> copy() 
    Returns a deep copy of the receiver; uses clone() and casts the result.
 public Q[] elements() 
    Returns the elements currently stored, including invalid elements between size and capacity, if any. WARNING: For efficiency reasons and to keep memory usage low, the array is not copied. So if subsequently you modify the returned array directly via the [] operator, be sure you know what you're doing.
 public  void elements(T[] elements) 
    Sets the receiver's elements to be the specified array (not a copy of it). The size and capacity of the list is the length of the array. WARNING: For efficiency reasons and to keep memory usage low, the array is not copied. So if subsequently you modify the specified array directly via the [] operator, be sure you know what you're doing.
 public  void ensureCapacity(int minCapacity) 
    Ensures that the receiver can hold at least the specified number of elements without needing to allocate new internal memory. If necessary, allocates new internal memory and increases the capacity of the receiver.
 public boolean equals(Object otherObj) 
    Compares the specified Object with the receiver. Returns true if and only if the specified Object is also an ArrayList of the same type, both Lists have the same size, and all corresponding pairs of elements in the two Lists are identical. In other words, two Lists are defined to be equal if they contain the same elements in the same order.
 public boolean forEach(ObjectProcedure<T> procedure) 
    Applies a procedure to each element of the receiver, if any. Starts at index 0, moving rightwards.
 public T get(int index) 
    Returns the element at the specified position in the receiver.
 public T getQuick(int index) 
    Returns the element at the specified position in the receiver; WARNING: Does not check preconditions. Provided with invalid parameters this method may return invalid elements without throwing any exception! You should only use this method when you are absolutely sure that the index is within bounds. Precondition (unchecked): index >= 0 && index < size().
 public int indexOfFromTo(T element,
    int from,
    int to) 
    Returns the index of the first occurrence of the specified element. Returns -1 if the receiver does not contain this element. Searches between from, inclusive and to, inclusive. Tests for identity.
 public int lastIndexOfFromTo(T element,
    int from,
    int to) 
    Returns the index of the last occurrence of the specified element. Returns -1 if the receiver does not contain this element. Searches beginning at to, inclusive until from, inclusive. Tests for identity.
 public  void mergeSortFromTo(int from,
    int to) 
 public AbstractObjectList<T> partFromTo(int from,
    int to) 
    Returns a new list of the part of the receiver between from, inclusive, and to, inclusive.
 public  void quickSortFromTo(int from,
    int to) 
 public  void removeFromTo(int fromIndex,
    int toIndex) 
 public  void replaceFromWith(int from,
    Collection<T> other) 
 public  void reverse() 
    Reverses the elements of the receiver. Last becomes first, second last becomes second first, and so on.
 public  void set(int index,
    T element) 
    Replaces the element at the specified position in the receiver with the specified element.
 public  void setQuick(int index,
    T element) 
    Replaces the element at the specified position in the receiver with the specified element; WARNING: Does not check preconditions. Provided with invalid parameters this method may access invalid indexes without throwing any exception! You should only use this method when you are absolutely sure that the index is within bounds. Precondition (unchecked): index >= 0 && index < size().
 public int size() 
 public  void trimToSize() 
    Trims the capacity of the receiver to be the receiver's current size. Releases any superfluous internal memory. An application can use this operation to minimize the storage of the receiver.