ariba.util.core
Class SparseVector
java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractList
ariba.util.core.Vector
ariba.util.core.SparseVector
- All Implemented Interfaces:
- Externalizable, Serializable, Cloneable, Iterable, Collection, List
public class SparseVector
- extends Vector
- implements 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(Object element,
int index)
Finds the location of an element in the List starting at a
given offset. |
int |
lastIndexOf(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 |
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
indexOf
public int indexOf(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(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-2009 Ariba, Inc. All Rights Reserved.