ariba.util.core
Class Vector

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

public class Vector
extends java.util.AbstractList
implements java.lang.Cloneable, java.io.Externalizable

Object subclass that manages an array of objects. A Vector cannot contain null.

See Also:
Serialized Form

Constructor Summary
Vector()
          Deprecated. use ListUtil.list
Vector(java.util.Collection collection)
          Deprecated. use ListUtil.list()
Vector(int initialCapacity)
          Deprecated. use ListUtil.list
Vector(java.lang.Object[] array)
          Deprecated. use ListUtil.list
Vector(java.lang.Object[] array, boolean copy)
          Deprecated. use ListUtil.arrayToList
Vector(Vector copy)
          Deprecated. use ListUtil.list
 
Method Summary
 void add(int index, java.lang.Object element)
          Inserts the specified element at the specified position in this list.
 boolean add(java.lang.Object element)
          Appends the specified element to the end of this List (optional operation).
 boolean addAll(java.util.Collection c)
          Adds the elements contained in c to the end of the Vector.
 void addElement(java.lang.Object element)
          Deprecated. use add ()
 void addElementIfAbsent(java.lang.Object element)
          Deprecated. use ListUtil.addElementIfAbsent. Since performance of this method is linear with the size of the list, consider using a different datastructure such as java.util.HashSet
 void addElements(Vector aVector)
          Deprecated. use addAll instead
 void addElementsIfAbsent(Vector aVector)
          Deprecated. use ListUtil.addElementsIfAbsent. Since performance of this method is linear with the size of the list, consider using a different datastructure such as java.util.HashSet
 int capacity()
          Deprecated. code should not be concerned with such internal details
 void clear()
          Removes all of the elements from this collection.
 java.lang.Object clone()
          Clones the Vector.
 boolean contains(java.lang.Object element)
          Searches for the specified element in the Vector.
 boolean containsIdentical(java.lang.Object element)
          Deprecated. use ListUtil.containsIdentical instead
 void copyInto(java.lang.Object[] anArray)
          Deprecated. use toArray(Object[])
 void copyInto(java.lang.Object[] anArray, int startingAt)
          Deprecated. use ariba.util.core.ListUtil.copyInto()
 int count()
          Deprecated. use size()
 java.lang.Object[] elementArray()
          Deprecated. use toArray
 java.lang.Object[] elementArrayNoCopy()
          Deprecated. this is not supported with java's collection classes and should not be used by Ariba code. Callers should take the performance hit of using the supported methods toArray clear and addElements(ListUtil.arrayToList(Object[]))
 java.lang.Object elementAt(int index)
          Deprecated. use get
 java.util.Enumeration elements()
          Deprecated. use iterator ()
 java.util.Enumeration elements(int index)
          Deprecated. use listIterator(int)
 void ensureCapacity(int minCapacity)
          Deprecated. callers do not need to be aware of internal storage details
 boolean equals(java.lang.Object that)
          Compares the specified object with this list for equality.
 java.lang.Object firstElement()
          Deprecated. see ariba.util.core.ListUtil.firstElement
 java.lang.Object get(int index)
          Returns the element at the specified position in this list.
 int indexOf(java.lang.Object element)
          Finds the location of an element in the Vector.
 int indexOf(java.lang.Object element, int index)
          Deprecated. use subList() and indexOf(Object) instead
 int indexOfIdentical(java.lang.Object element)
          Deprecated. use ListUtil.indexOfIdentical instead
 int indexOfIdentical(java.lang.Object element, int index)
          Deprecated. use subList and ListUtil.indexOfIdentical instead
 boolean insertElementAfter(java.lang.Object element, java.lang.Object existingElement)
          Deprecated. use ListUtil
 void insertElementAt(java.lang.Object element, int index)
          Deprecated. use add(int, Object) instead
 boolean insertElementBefore(java.lang.Object element, java.lang.Object existingElement)
          Deprecated. use ListUtil
 boolean isEmpty()
          Checks if the Vector is empty.
 boolean isModifiable()
          Deprecated. not supported with Collections.unmodifiableList
 java.lang.Object lastElement()
          Returns the Vector's last element without modification of the Vector.
 int lastIndexOf(java.lang.Object element)
          Searches for the last occurrence of the element element in the Vector.
 int lastIndexOf(java.lang.Object element, int index)
          Search for the the last index of element in the vector, at or prior to index.
 boolean onlyContains(java.lang.Object element)
          Checks if the vector contains element and nothing else.
 void readExternal(java.io.ObjectInput input)
          Reads object data from the given input and restores the contents of this object.
 java.lang.Object remove(int index)
          Removes the element at the specified position in this list (optional operation).
 boolean remove(java.lang.Object element)
          Removes the first occurrence of element from the Vector.
 boolean removeAll(java.util.Collection c)
          Removes from this collection all of its elements that are contained in the specified collection.
 void removeAll(java.lang.Object element)
          Removes all occurrences of element from the Vector.
 void removeAllElements()
          Deprecated. use clear
 boolean removeElement(java.lang.Object element)
          Deprecated. use remove(java.lang.Object)
 java.lang.Object removeElementAt(int index)
          Deprecated. use remove(int)
 boolean removeElementIdentical(java.lang.Object element)
          Removes the first occurrence of element from the Vector.
 java.lang.Object removeFirstElement()
          Removes and returns the element at index 0, or null if the Vector is empty.
 java.lang.Object removeLastElement()
          Removes and returns the element at index count() - 1 (the last object) or null if the Vector is empty.
 void removeRange(int fromIndex, int toIndex)
          Removes from this list all of the elements whose index is between fromIndex, inclusive, and toIndex, exclusive.
 java.lang.Object replaceElement(java.lang.Object oldElement, java.lang.Object newElement)
          Deprecated. use ListUtil.replace
 java.lang.Object replaceElementAt(int index, java.lang.Object element)
          Deprecated. use set
 java.lang.Object set(int index, java.lang.Object element)
          Replaces the element at the specified position in this list with the specified element.
 void setElementAt(java.lang.Object element, int index)
          Sets the element at index to element.
 void setUnmodifiable()
          Deprecated. use Collections.unmodifiableList
 int size()
          Returns the number of elements in the Vector.
 void sort(boolean ascending)
          Deprecated. use ListUtil.sortStrings(List, boolean)
 void sortStrings(boolean ascending, boolean ignoreCase)
          Deprecated. use ListUtil.sortStrings(List, boolean, boolean)
 java.lang.String toString()
          Returns the Vector's string representation.
 void trimToSize()
          Deprecated. callers should not worry about internal storage details.
 void writeExternal(java.io.ObjectOutput output)
          Writes this Vector's data out to the given stream.
 
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

Vector

public Vector()
Deprecated. use ListUtil.list

Constructs a Vector with an initial capacity of 4 elements.

See Also:
ListUtil.list()

Vector

public Vector(int initialCapacity)
Deprecated. use ListUtil.list

Primitive constructor. Constructs a Vector large enough to hold initialCapacity elements. The Vector will grow to accommodate additional objects, as needed.

Parameters:
initialCapacity - the initial capacity; must be greater than or equal to zero
See Also:
ListUtil.list(int)

Vector

public Vector(java.lang.Object[] array,
              boolean copy)
Deprecated. use ListUtil.arrayToList

Creates a Vector from the objects in the given array. The elements in the array are copied if the boolean is true.

Parameters:
array - the array to use as the initial contents of the vector
copy - if true, the array is copied; if false the array is shared. However internal Vector operations may copy or modify the array at a later point, so sharing the array in a active manner should be avoided.
See Also:
ListUtil.arrayToList(java.lang.Object[], boolean)

Vector

public Vector(java.lang.Object[] array)
Deprecated. use ListUtil.list

Creates a Vector from the objects in the given array. The elements in the array are copied.

Parameters:
array - the array to use as the initial contents of the vector
See Also:
ListUtil.arrayToList(java.lang.Object[])

Vector

public Vector(Vector copy)
Deprecated. use ListUtil.list

Creates a Vector from the objects in the given Vector. The elements in the array are copied.

Parameters:
copy - the array to use as the initial contents of the vector
See Also:
ListUtil.collectionToList(java.util.Collection)

Vector

public Vector(java.util.Collection collection)
Deprecated. use ListUtil.list()

Creates a new Vector with the same contents as the given Collection.

Parameters:
collection - collection
See Also:
ListUtil.collectionToList(java.util.Collection)
Method Detail

clone

public java.lang.Object clone()
Clones the Vector. Does not clone its elements.

Overrides:
clone in class java.lang.Object
Returns:
a shallow copy of this Vector

count

public int count()
Deprecated. use size()

Returns the number of elements in the Vector. This returns the same value as size().

Returns:
the number of elements currently stored in the vector.
See Also:
size()

size

public int size()
Returns the number of elements in the Vector. This returns the same value as count().

Specified by:
size in interface java.util.Collection
Specified by:
size in interface java.util.List
Specified by:
size in class java.util.AbstractCollection
Returns:
the number of elements currently stored in the vector.

isModifiable

public boolean isModifiable()
Deprecated. not supported with Collections.unmodifiableList

Returns whether this is modifiable, that is whether the methods that change the elements of this instance are supported or not.

For the client, unmodifiability is a promise that the elements of a Vector won't change, not that the internal representation won't change.

Modifiable Vectors can be made unmodifiable (see setUnmodifiable()) but not vice-versa. Setting a Vector to be unmodifiable is thus a one-way operation. Unmodifiable Vectors are consistent with the JDK 1.2 specification in that they will throw an UnsupportedOperationException if a mutator method is called.

Modifiable is the default state of Vectors. All constructors of this class create modifiable Vectors. Note that clone() honors modifiability, that is, clones of unmodifiable Vectors are unmodifiable.

Returns:
true if this is modifiable, false otherwise

setUnmodifiable

public void setUnmodifiable()
Deprecated. use Collections.unmodifiableList

Sets this to be unmodifiable. This freezes the Vector and it cannot subsequently be made modifiable again.

See Also:
Collections.unmodifiableList(java.util.List)

isEmpty

public boolean isEmpty()
Checks if the Vector is empty.

Specified by:
isEmpty in interface java.util.Collection
Specified by:
isEmpty in interface java.util.List
Overrides:
isEmpty in class java.util.AbstractCollection
Returns:
true if the Vector contains no elements.

addElementIfAbsent

public void addElementIfAbsent(java.lang.Object element)
Deprecated. use ListUtil.addElementIfAbsent. Since performance of this method is linear with the size of the list, consider using a different datastructure such as java.util.HashSet

Adds element as the last element of the Vector, if not already present within the Vector.

Parameters:
element - the element to add
Throws:
java.lang.NullPointerException - if element is null.
See Also:
ListUtil.addElementIfAbsent(java.util.List, T)

insertElementBefore

public boolean insertElementBefore(java.lang.Object element,
                                   java.lang.Object existingElement)
Deprecated. use ListUtil

Inserts element before existingElement in the Vector.

Parameters:
element - the element to insert into the vector
existingElement - the element to insert before. If existingElement is null or cannot be found, this method does nothing
Returns:
true if element was inserted and false if it was not.
Throws:
java.lang.NullPointerException - if element is null.
See Also:
ListUtil.insertElementBefore(java.util.List, T, T)

insertElementAfter

public boolean insertElementAfter(java.lang.Object element,
                                  java.lang.Object existingElement)
Deprecated. use ListUtil

Inserts element after existingElement in the Vector.

Parameters:
element - the element to insert into the vector
existingElement - the element to insert after. If existingElement is null or cannot be found, this method does nothing
Returns:
true if element was inserted and false if it was not.
Throws:
java.lang.NullPointerException - if element is null.
See Also:
ListUtil.insertElementAfter(java.util.List, T, T)

addElementsIfAbsent

public void addElementsIfAbsent(Vector aVector)
Deprecated. use ListUtil.addElementsIfAbsent. Since performance of this method is linear with the size of the list, consider using a different datastructure such as java.util.HashSet

Adds the elements contained in aVector that are not already present in the Vector to the end of the Vector.

Parameters:
aVector - a vector of the elements to be added to this vector
See Also:
ListUtil.addElementsIfAbsent(java.util.List, java.util.Collection)

addElements

public void addElements(Vector aVector)
Deprecated. use addAll instead

Adds the elements contained in aVector to the end of the Vector.

Parameters:
aVector - a vector of the elements to be added to this vector
See Also:
addAll(java.util.Collection)

removeAll

public void removeAll(java.lang.Object element)
Removes all occurrences of element from the Vector.

Parameters:
element - the element to remove.

removeFirstElement

public java.lang.Object removeFirstElement()
Removes and returns the element at index 0, or null if the Vector is empty.

Returns:
the first element that was in the vector, but has now been removed.

removeLastElement

public java.lang.Object removeLastElement()
Removes and returns the element at index count() - 1 (the last object) or null if the Vector is empty.

Returns:
the last element that was in the vector, but has now been removed.

replaceElementAt

public java.lang.Object replaceElementAt(int index,
                                         java.lang.Object element)
Deprecated. use set

Replaces the element at index with element.

Parameters:
index - the location of the element to replace
element - the element to replace the existing element with
Returns:
the replaced object
Throws:
java.lang.ArrayIndexOutOfBoundsException - if index is an illegal index value.
java.lang.NullPointerException - if element is null
See Also:
set(int, java.lang.Object)

replaceElement

public java.lang.Object replaceElement(java.lang.Object oldElement,
                                       java.lang.Object newElement)
Deprecated. use ListUtil.replace

Replaces the element oldElement with newElement.

Parameters:
oldElement - which element to replace
newElement - the element to replace the existing element with
Returns:
oldElement if it was replaced or null if it was not found.
Throws:
java.lang.NullPointerException - if newElement is null
See Also:
ListUtil.replace(java.util.List,java.lang.Object,java.lang.Object)

elementArray

public java.lang.Object[] elementArray()
Deprecated. use toArray

Returns an array containing the Vector's contents. The Vector does not keep a reference to the returned value so it is safe to modify if desired.

Returns:
a copy of the internal array with a length exactly equal to the number of elements in the array.
See Also:
AbstractCollection.toArray()

elementArrayNoCopy

public java.lang.Object[] elementArrayNoCopy()
Deprecated. this is not supported with java's collection classes and should not be used by Ariba code. Callers should take the performance hit of using the supported methods toArray clear and addElements(ListUtil.arrayToList(Object[]))

Returns an array containing the Vector's contents. Warning! Does not copy the array! Changing the elements in the returned array is very likely to change the elements of this Vector even if it is unmodifiable. Use this method with caution.

Returns:
the internal array used to store elements. The length may be larger than the number of elements currently in use--as returned by count(). This storage is still activly used by the vector which has no way of knowing about any changes you might make to it.

copyInto

public void copyInto(java.lang.Object[] anArray)
Deprecated. use toArray(Object[])

Copies the Vector's elements into anArray. This array must be large enough to contain the elements.

Parameters:
anArray - the array to copy the Vector's elements into. Any elements existing in anArray beyond the count of elements in this Vector are left unchanged.
See Also:
AbstractCollection.toArray(java.lang.Object[])

copyInto

public void copyInto(java.lang.Object[] anArray,
                     int startingAt)
Deprecated. use ariba.util.core.ListUtil.copyInto()

Copies the Vector's elements into anArray at a specified offset. This array must be large enough to contain the elements.

Parameters:
anArray - the array to copy the Vector's elements into. Any elements existing in anArray beyond the count of elements copied from this Vector are left unchanged.
startingAt - the location in anArray to begin copying into
See Also:
ListUtil.copyInto(java.util.List, java.lang.Object[], int)

trimToSize

public void trimToSize()
Deprecated. callers should not worry about internal storage details.

Minimizes the Vector's storage area. This will cause elementArray's array to have a length equal to the count of the elements in the Vector.

See Also:
count, elementArray()

ensureCapacity

public void ensureCapacity(int minCapacity)
Deprecated. callers do not need to be aware of internal storage details

Increases, if necessary, the the Vector's storage area so that it can contain at least minCapacity elements.

Parameters:
minCapacity - the number of elements that this Vector can hold without having to grow it's internal storage.

capacity

public int capacity()
Deprecated. code should not be concerned with such internal details

Returns the number of elements that can be stored in the Vector without increasing the Vector's storage area.

Returns:
the current size of the internal storage of the vector. This may be different from the value returned by size() and count().

elements

public java.util.Enumeration elements()
Deprecated. use iterator ()

Returns an Enumeration that can be used to iterate through all of the Vector's elements.

Returns:
an enumeration over the elements in the Vector.
See Also:
AbstractList.iterator()

elements

public java.util.Enumeration elements(int index)
Deprecated. use listIterator(int)

Returns an Enumeration that can be used to iterate through the vector's elements beginning at element index.

Parameters:
index - the index of the first element to be used in the iteration
Returns:
an enumeration over the specified elements in the Vector.
See Also:
AbstractList.listIterator(int)

contains

public boolean contains(java.lang.Object element)
Searches for the specified element in the Vector.

Specified by:
contains in interface java.util.Collection
Specified by:
contains in interface java.util.List
Overrides:
contains in class java.util.AbstractCollection
Parameters:
element - the element to search for
Returns:
true if the Vector contains element. The comparison is performed using equals() with each element.

onlyContains

public boolean onlyContains(java.lang.Object element)
Checks if the vector contains element and nothing else.

Parameters:
element - the element to check for; It uses equals() to perform the containment test.
Returns:
true if the RowVector contains only element and no other object; and false otherwise.

containsIdentical

public boolean containsIdentical(java.lang.Object element)
Deprecated. use ListUtil.containsIdentical instead

Checks if the vector contains the element element using the == operator.

Parameters:
element - the element to search for; the == operator is used for comparison
Returns:
true if the Vector contains element, false otherwise
See Also:
ListUtil.containsIdentical(java.util.List, T)

indexOf

public int indexOf(java.lang.Object element)
Finds the location of an element in the Vector.

Specified by:
indexOf in interface java.util.List
Overrides:
indexOf in class java.util.AbstractList
Parameters:
element - the element to search for. The comparison is performed using equals() with each element.
Returns:
the index of element in the Vector. Returns -1 if the element is not present.

indexOf

public int indexOf(java.lang.Object element,
                   int index)
Deprecated. use subList() and indexOf(Object) instead

Finds the location of an element in the Vector starting at a given offset.

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

indexOfIdentical

public int indexOfIdentical(java.lang.Object element,
                            int index)
Deprecated. use subList and ListUtil.indexOfIdentical instead

Finds the location of an element in the Vector starting at a given offset using the == operator.

Parameters:
element - the element to search for. The comparison is performed using == with each element.
index - the offset in the Vector to begin searching
Returns:
the index of element in the Vector. Returns -1 if the element is not present in the region searched.
See Also:
ListUtil.indexOfIdentical(java.util.List, T), AbstractList.subList(int, int)

indexOfIdentical

public int indexOfIdentical(java.lang.Object element)
Deprecated. use ListUtil.indexOfIdentical instead

Finds the location of an element in the Vector using the == operator for comparison.

Parameters:
element - the element to search for. The comparison is performed using == with each element.
Returns:
the index of element in the Vector. Returns -1 if the element is not present.
See Also:
ListUtil.indexOfIdentical(java.util.List, T)

lastIndexOf

public int lastIndexOf(java.lang.Object element)
Searches for the last occurrence of the element element in the Vector.

Specified by:
lastIndexOf in interface java.util.List
Overrides:
lastIndexOf in class java.util.AbstractList
Parameters:
element - the element to search for. The comparison is performed using equals() with each element.
Returns:
the last index of element in the Vector. Returns -1 if the element is not present.

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.

Parameters:
element - the element to search for in the Vector. 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.

elementAt

public java.lang.Object elementAt(int index)
Deprecated. use get

Find the element at the specified location.

Parameters:
index - the index of the element in the Vector to return
Returns:
the element at index.
Throws:
java.lang.ArrayIndexOutOfBoundsException - if the index is greater than or equal to the number of elements in the Vector
See Also:
get(int)

firstElement

public java.lang.Object firstElement()
Deprecated. see ariba.util.core.ListUtil.firstElement

Returns the Vector's first element without modification of the Vector.

Returns:
the first element, or null if there are no elements.
See Also:
ListUtil.firstElement(java.util.List)

lastElement

public java.lang.Object lastElement()
Returns the Vector's last element without modification of the Vector.

Returns:
the last element, or null if there are no elements.

setElementAt

public void setElementAt(java.lang.Object element,
                         int index)
Sets the element at index to element.

Parameters:
element - the element to place into the Vector at the specified location
index - the location in the vector to place the element.
Throws:
java.lang.NullPointerException - if element is null
java.lang.ArrayIndexOutOfBoundsException - if index is an illegal index value.

removeElementAt

public java.lang.Object removeElementAt(int index)
Deprecated. use remove(int)

Removes the element at index.

Parameters:
index - the index of the element in the Vector to remove
Returns:
the element that was removed
Throws:
java.lang.ArrayIndexOutOfBoundsException - if index is an illegal index value.
See Also:
remove(int)

insertElementAt

public void insertElementAt(java.lang.Object element,
                            int index)
Deprecated. use add(int, Object) instead

Inserts element into the Vector at index. All elements at and after index are moved.

Parameters:
element - the element to insert into the Vector
index - the location to insert the element at
Throws:
java.lang.ArrayIndexOutOfBoundsException - if index is an illegal index value.
java.lang.NullPointerException - if element is null.
See Also:
add(int, java.lang.Object)

addElement

public void addElement(java.lang.Object element)
Deprecated. use add ()

Adds element to the end of the Vector.

Parameters:
element - the element to add to the Vector
Throws:
java.lang.NullPointerException - if element is null
See Also:
add(Object)

remove

public boolean remove(java.lang.Object element)
Removes the first occurrence of element from the Vector. The equals() comparison is used. At most one instance of the element will be removed on each call.

Specified by:
remove in interface java.util.Collection
Specified by:
remove in interface java.util.List
Overrides:
remove in class java.util.AbstractCollection
Parameters:
element - the element to remove from the Vector. The comparison is performed using equals() with each element.
Returns:
true if the element was removed, false otherwise

removeElement

public boolean removeElement(java.lang.Object element)
Deprecated. use remove(java.lang.Object)

Removes the first occurrence of element from the Vector. The equals() comparison is used. At most one instance of the element will be removed on each call.

Parameters:
element - the element to remove from the Vector. The comparison is performed using equals() with each element.
Returns:
true if the element was removed, false otherwise

removeElementIdentical

public boolean removeElementIdentical(java.lang.Object element)
Removes the first occurrence of element from the Vector. The == comparison is used. At most one instance of the element will be removed on each call.

Parameters:
element - the element to remove from the Vector. The comparison is performed using == with each element.
Returns:
true if the element was removed, false otherwise

removeAllElements

public void removeAllElements()
Deprecated. use clear

Empties the Vector, but leaves its capacity unchanged.

See Also:
clear()

sort

public void sort(boolean ascending)
Deprecated. use ListUtil.sortStrings(List, boolean)

Sorts the Vector's contents. String comparisons are case sensitive.

Parameters:
ascending - if true the Vector will be sorted in ascending order, if false in descending order
Throws:
java.lang.ClassCastException - if the Vector's contents are not all Strings, or are not Comparable.
See Also:
ListUtil.sortStrings(List, boolean)

sortStrings

public void sortStrings(boolean ascending,
                        boolean ignoreCase)
Deprecated. use ListUtil.sortStrings(List, boolean, boolean)

Sorts the Vector's contents, presuming all elements are of type String.

Parameters:
ascending - if true the Vector will be sorted in ascending order, if false in descending order
ignoreCase - if true the Vector's Strings will be sorted in a case insensitive manner, if false in a case sensitive manner
Throws:
java.lang.ClassCastException - if the Vector's contents are not all Strings.
See Also:
ListUtil.sortStrings(List, boolean, boolean)

toString

public java.lang.String toString()
Returns the Vector's string representation.

Overrides:
toString in class java.util.AbstractCollection
Returns:
a formatted string representation of the Vector's contents. It will be recursivly formated if the Vector contains other Lists or Maps.

writeExternal

public void writeExternal(java.io.ObjectOutput output)
                   throws java.io.IOException
Writes this Vector's data out to the given stream. Implementation of the Externalizable interface

Specified by:
writeExternal in interface java.io.Externalizable
Parameters:
output - the stream to write the object to
Throws:
java.io.IOException - Includes any I/O exceptions that may occur

readExternal

public void readExternal(java.io.ObjectInput input)
                  throws java.io.IOException,
                         java.lang.ClassNotFoundException
Reads object data from the given input and restores the contents of this object. Implementation of the Externalizable interface.

Specified by:
readExternal in interface java.io.Externalizable
Parameters:
input - the stream to read data from in order to restore the object
Throws:
java.io.IOException - if I/O errors occur
java.lang.ClassNotFoundException - If the class for an object being restored cannot be found.

equals

public boolean equals(java.lang.Object that)
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==null ? e2==null : e1.equals(e2)).) In other words, two lists are defined to be equal if they contain the same elements in the same order.

Specified by:
equals in interface java.util.Collection
Specified by:
equals in interface java.util.List
Overrides:
equals in class java.util.AbstractList
Parameters:
that - the object to be compared for equality with this list.
Returns:
true if the specified object is equal to this list.

get

public java.lang.Object get(int index)
Returns the element at the specified position in this list.

Specified by:
get in interface java.util.List
Specified by:
get in class java.util.AbstractList
Parameters:
index - index of element to return.
Returns:
the element at the specified position in this list.
Throws:
java.lang.IndexOutOfBoundsException - if the given index is out of range (index < 0 || index >= size()).

set

public java.lang.Object set(int index,
                            java.lang.Object element)
Replaces the element at the specified position in this list with the specified element.

Specified by:
set in interface java.util.List
Overrides:
set in class java.util.AbstractList
Parameters:
index - index of element to replace.
element - element to be stored at the specified position.
Returns:
the element previously at the specified position.
Throws:
java.lang.ClassCastException - if the class of the specified element prevents it from being added to this list.
java.lang.IllegalArgumentException - if some aspect of the specified element prevents it from being added to this list.
java.lang.IndexOutOfBoundsException - if the specified index is out of range (index < 0 || index >= size()).

add

public void add(int index,
                java.lang.Object element)
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).

Specified by:
add in interface java.util.List
Overrides:
add in class java.util.AbstractList
Parameters:
index - index at which the specified element is to be inserted.
element - element to be inserted.
Throws:
java.lang.ClassCastException - if the class of the specified element prevents it from being added to this list.
java.lang.IllegalArgumentException - if some aspect of the specified element prevents it from being added to this list.
java.lang.IndexOutOfBoundsException - index is out of range (index < 0 || index > size()).

add

public boolean add(java.lang.Object element)
Appends the specified element to the end of this List (optional operation).

Specified by:
add in interface java.util.Collection
Specified by:
add in interface java.util.List
Overrides:
add in class java.util.AbstractList
Parameters:
element - element to be appended to this list.
Returns:
true (as per the general contract of Collection.add).
Throws:
java.lang.ClassCastException - if the class of the specified element prevents it from being added to this set.
java.lang.IllegalArgumentException - some aspect of this element prevents it from being added to this collection.

addAll

public boolean addAll(java.util.Collection c)
Adds the elements contained in c to the end of the Vector.

Specified by:
addAll in interface java.util.Collection
Specified by:
addAll in interface java.util.List
Overrides:
addAll in class java.util.AbstractCollection
Parameters:
c - a collection of the elements to be added to this vector
Returns:
true if this vector changed as a result of the call

remove

public java.lang.Object remove(int index)
Removes the element at the specified position in this list (optional operation). Shifts any subsequent elements to the left (subtracts one from their indices). Returns the element that was removed from the list.

Specified by:
remove in interface java.util.List
Overrides:
remove in class java.util.AbstractList
Parameters:
index - the index of the element to remove.
Returns:
the element previously at the specified position.
Throws:
java.lang.IndexOutOfBoundsException - if the specified index is out of range (index < 0 || index >= size()).

clear

public void clear()
Removes all of the elements from this collection. The collection will be empty after this call returns (unless it throws an exception).

Specified by:
clear in interface java.util.Collection
Specified by:
clear in interface java.util.List
Overrides:
clear in class java.util.AbstractList

removeRange

public void removeRange(int fromIndex,
                        int toIndex)
Removes from this list all of the elements whose index is between fromIndex, inclusive, and toIndex, exclusive. Shifts any succeeding elements to the left (reduces their index). This call shortens the ArrayList by (toIndex - fromIndex) elements. (If toIndex==fromIndex, this operation has no effect.)

Overrides:
removeRange in class java.util.AbstractList
Parameters:
fromIndex - index of first element to be removed.
toIndex - index after last element to be removed.

removeAll

public boolean removeAll(java.util.Collection c)
Removes from this collection all of its elements that are contained in the specified collection.

Specified by:
removeAll in interface java.util.Collection
Specified by:
removeAll in interface java.util.List
Overrides:
removeAll in class java.util.AbstractCollection
Parameters:
c - elements to be removed from this collection.
Returns:
true if this collection changed as a result of the call.
See Also:
remove(Object), contains(Object)


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