ariba.util.core
Class SparseVector

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractList
          extended by ariba.util.core.Vector
              extended by ariba.util.core.SparseVector
All Implemented Interfaces:
java.io.Externalizable, java.io.Serializable, java.lang.Cloneable, java.lang.Iterable, java.util.Collection, java.util.List

public class SparseVector
extends Vector
implements java.lang.Cloneable

Object subclass that manages an array of objects. Unlike a Vector, a SparseVector can contain null.

See Also:
Serialized Form

Constructor Summary
SparseVector()
          Constructs a List with an initial capacity of 4 elements.
SparseVector(int initialCapacity, boolean dontAllowException)
          Primitive constructor.
 
Method Summary
 int indexOf(java.lang.Object element, int index)
          Finds the location of an element in the List starting at a given offset.
 int lastIndexOf(java.lang.Object element, int index)
          Search for the the last index of element in the vector, at or prior to index.
 
Methods inherited from class ariba.util.core.Vector
add, add, addAll, addElement, addElementIfAbsent, addElements, addElementsIfAbsent, capacity, clear, clone, contains, containsIdentical, copyInto, copyInto, count, elementArray, elementArrayNoCopy, elementAt, elements, elements, ensureCapacity, equals, firstElement, get, indexOf, indexOfIdentical, indexOfIdentical, insertElementAfter, insertElementAt, insertElementBefore, isEmpty, isModifiable, lastElement, lastIndexOf, onlyContains, readExternal, remove, remove, removeAll, removeAll, removeAllElements, removeElement, removeElementAt, removeElementIdentical, removeFirstElement, removeLastElement, removeRange, replaceElement, replaceElementAt, set, setElementAt, setUnmodifiable, size, sort, sortStrings, toString, trimToSize, writeExternal
 
Methods inherited from class java.util.AbstractList
addAll, hashCode, iterator, listIterator, listIterator, subList
 
Methods inherited from class java.util.AbstractCollection
containsAll, retainAll, toArray, toArray
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
containsAll, retainAll, toArray, toArray
 

Constructor Detail

SparseVector

public SparseVector()
Constructs a List with an initial capacity of 4 elements.


SparseVector

public SparseVector(int initialCapacity,
                    boolean dontAllowException)
Primitive constructor. Constructs a List large enough to hold initialCapacity elements. The List will grow to accommodate additional objects, as needed.

Parameters:
initialCapacity - the initial capacity; must be greater than or equal to zero
Method Detail

indexOf

public int indexOf(java.lang.Object element,
                   int index)
Finds the location of an element in the List starting at a given offset.

Overrides:
indexOf in class Vector
Parameters:
element - the element to search for. The comparison is performed using equals() with each element.
index - the offset in the List to begin searching
Returns:
the index of element in the List. Returns -1 if the element is not present in the region searched.
See Also:
AbstractList.subList(int, int), Vector.indexOf(Object)

lastIndexOf

public int lastIndexOf(java.lang.Object element,
                       int index)
Search for the the last index of element in the vector, at or prior to index.

Overrides:
lastIndexOf in class Vector
Parameters:
element - the element to search for in the List. The comparison is performed using equals() with each element.
index - the offset in the vector to start searching backwards from. The search is inclusive of the element at location index
Returns:
the index of the found element, or -1 if the element is not present in the region searched.


AribaWeb User Interface Development Framework
Copyright © 2000-2014 Ariba, Inc. All Rights Reserved.