Methods Summary |
---|
public boolean | add(java.lang.Object o)
modCount++;
ensureCapacityHelper(elementCount + 1);
elementData[elementCount++] = o;
return true;
|
public boolean | addAll(java.util.Collection c)
modCount++;
Object[] a = c.toArray();
int numNew = a.length;
ensureCapacityHelper(elementCount + numNew);
System.arraycopy(a, 0, elementData, elementCount, numNew);
elementCount += numNew;
return numNew != 0;
|
public boolean | addAll(int index, java.util.Collection c)
modCount++;
if (index < 0 || index > elementCount)
throw new ArrayIndexOutOfBoundsException(index);
Object[] a = c.toArray();
int numNew = a.length;
ensureCapacityHelper(elementCount + numNew);
int numMoved = elementCount - index;
if (numMoved > 0)
System.arraycopy(elementData, index, elementData, index + numNew,
numMoved);
System.arraycopy(a, 0, elementData, index, numNew);
elementCount += numNew;
return numNew != 0;
|
public void | addElement(java.lang.Object obj)
modCount++;
ensureCapacityHelper(elementCount + 1);
elementData[elementCount++] = obj;
|
public int | capacity()
return elementData.length;
|
public boolean | containsAll(java.util.Collection c)
Iterator e = c.iterator();
while (e.hasNext())
if(!contains(e.next()))
return false;
return true;
|
public void | copyInto(java.lang.Object[] anArray)
System.arraycopy(elementData, 0, anArray, 0, elementCount);
|
public java.lang.Object | elementAt(int index)
if (index >= elementCount) {
throw new ArrayIndexOutOfBoundsException(index + " >= " + elementCount);
}
return elementData[index];
|
public java.util.Enumeration | elements()
return new Enumeration() {
int count = 0;
public boolean hasMoreElements() {
return count < elementCount;
}
public Object nextElement() {
if (count < elementCount) {
return elementData[count++];
}
throw new NoSuchElementException("Vector Enumeration");
}
};
|
public void | ensureCapacity(int minCapacity)
modCount++;
ensureCapacityHelper(minCapacity);
|
private void | ensureCapacityHelper(int minCapacity)
int oldCapacity = elementData.length;
if (minCapacity > oldCapacity) {
Object oldData[] = elementData;
int newCapacity = (capacityIncrement > 0) ?
(oldCapacity + capacityIncrement) : (oldCapacity * 2);
if (newCapacity < minCapacity) {
newCapacity = minCapacity;
}
elementData = new Object[newCapacity];
System.arraycopy(oldData, 0, elementData, 0, elementCount);
}
|
public boolean | equals(java.lang.Object o)
if (o == this)
return true;
if (!(o instanceof List))
return false;
ListIterator e1 = listIterator();
ListIterator e2 = ((List) o).listIterator();
while(e1.hasNext() && e2.hasNext()) {
Object o1 = e1.next();
Object o2 = e2.next();
if (!(o1==null ? o2==null : o1.equals(o2)))
return false;
}
return !(e1.hasNext() || e2.hasNext());
|
public java.lang.Object | firstElement()
if (elementCount == 0) {
throw new NoSuchElementException();
}
return elementData[0];
|
public java.lang.Object | get(int index)
if (index >= elementCount)
throw new ArrayIndexOutOfBoundsException(index);
return elementData[index];
|
public int | hashCode()
int hashCode = 1;
Iterator i = iterator();
while (i.hasNext()) {
Object obj = i.next();
hashCode = 31*hashCode + (obj==null ? 0 : obj.hashCode());
}
return hashCode;
|
public int | indexOf(java.lang.Object elem, int index)
if (elem == null) {
for (int i = index ; i < elementCount ; i++)
if (elementData[i]==null)
return i;
} else {
for (int i = index ; i < elementCount ; i++)
if (elem.equals(elementData[i]))
return i;
}
return -1;
|
public void | insertElementAt(java.lang.Object obj, int index)
modCount++;
if (index > elementCount) {
throw new ArrayIndexOutOfBoundsException(index
+ " > " + elementCount);
}
ensureCapacityHelper(elementCount + 1);
System.arraycopy(elementData, index, elementData, index + 1, elementCount - index);
elementData[index] = obj;
elementCount++;
|
public boolean | isEmpty()
return elementCount == 0;
|
public java.lang.Object | lastElement()
if (elementCount == 0) {
throw new NoSuchElementException();
}
return elementData[elementCount - 1];
|
public int | lastIndexOf(java.lang.Object elem)
return lastIndexOf(elem, elementCount-1);
|
public int | lastIndexOf(java.lang.Object elem, int index)
if (index >= elementCount)
throw new IndexOutOfBoundsException(index + " >= "+ elementCount);
if (elem == null) {
for (int i = index; i >= 0; i--)
if (elementData[i]==null)
return i;
} else {
for (int i = index; i >= 0; i--)
if (elem.equals(elementData[i]))
return i;
}
return -1;
|
public static oracle.toplink.essentials.internal.helper.NonSynchronizedVector | newInstance(int initialCapacity, int capacityIncrement)
return new NonSynchronizedVector(initialCapacity, capacityIncrement);
|
public static oracle.toplink.essentials.internal.helper.NonSynchronizedVector | newInstance(int initialCapacity)
return new NonSynchronizedVector(initialCapacity);
|
public static oracle.toplink.essentials.internal.helper.NonSynchronizedVector | newInstance()
return new NonSynchronizedVector();
|
public static oracle.toplink.essentials.internal.helper.NonSynchronizedVector | newInstance(java.util.Collection c)
return new NonSynchronizedVector(c);
|
public java.lang.Object | remove(int index)
modCount++;
if (index >= elementCount)
throw new ArrayIndexOutOfBoundsException(index);
Object oldValue = elementData[index];
int numMoved = elementCount - index - 1;
if (numMoved > 0)
System.arraycopy(elementData, index+1, elementData, index,
numMoved);
elementData[--elementCount] = null; // Let gc do its work
return oldValue;
|
public boolean | removeAll(java.util.Collection c)
boolean modified = false;
Iterator e = iterator();
while (e.hasNext()) {
if(c.contains(e.next())) {
e.remove();
modified = true;
}
}
return modified;
|
public void | removeAllElements()
modCount++;
// Let gc do its work
for (int i = 0; i < elementCount; i++)
elementData[i] = null;
elementCount = 0;
|
public boolean | removeElement(java.lang.Object obj)
modCount++;
int i = indexOf(obj);
if (i >= 0) {
removeElementAt(i);
return true;
}
return false;
|
public void | removeElementAt(int index)
modCount++;
if (index >= elementCount) {
throw new ArrayIndexOutOfBoundsException(index + " >= " +
elementCount);
} else if (index < 0) {
throw new ArrayIndexOutOfBoundsException(index);
}
int j = elementCount - index - 1;
if (j > 0) {
System.arraycopy(elementData, index + 1, elementData, index, j);
}
elementCount--;
elementData[elementCount] = null; /* to let gc do its work */
|
protected void | removeRange(int fromIndex, int toIndex)
modCount++;
int numMoved = elementCount - toIndex;
System.arraycopy(elementData, toIndex, elementData, fromIndex,
numMoved);
// Let gc do its work
int newElementCount = elementCount - (toIndex-fromIndex);
while (elementCount != newElementCount)
elementData[--elementCount] = null;
|
public boolean | retainAll(java.util.Collection c)
boolean modified = false;
Iterator e = iterator();
while (e.hasNext()) {
if(!c.contains(e.next())) {
e.remove();
modified = true;
}
}
return modified;
|
public java.lang.Object | set(int index, java.lang.Object element)
if (index >= elementCount)
throw new ArrayIndexOutOfBoundsException(index);
Object oldValue = elementData[index];
elementData[index] = element;
return oldValue;
|
public void | setElementAt(java.lang.Object obj, int index)
if (index >= elementCount) {
throw new ArrayIndexOutOfBoundsException(index + " >= " +
elementCount);
}
elementData[index] = obj;
|
public void | setSize(int newSize)
modCount++;
if (newSize > elementCount) {
ensureCapacityHelper(newSize);
} else {
for (int i = newSize ; i < elementCount ; i++) {
elementData[i] = null;
}
}
elementCount = newSize;
|
public int | size()
return elementCount;
|
public java.lang.Object[] | toArray()
Object[] result = new Object[elementCount];
System.arraycopy(elementData, 0, result, 0, elementCount);
return result;
|
public java.lang.Object[] | toArray(java.lang.Object[] a)
if (a.length < elementCount)
a = (Object[])java.lang.reflect.Array.newInstance(
a.getClass().getComponentType(), elementCount);
System.arraycopy(elementData, 0, a, 0, elementCount);
if (a.length > elementCount)
a[elementCount] = null;
return a;
|
public java.lang.String | toString()
StringBuffer buf = new StringBuffer();
Iterator e = iterator();
buf.append("[");
int maxIndex = size() - 1;
for (int i = 0; i <= maxIndex; i++) {
buf.append(String.valueOf(e.next()));
if (i < maxIndex)
buf.append(", ");
}
buf.append("]");
return buf.toString();
|
public void | trimToSize()
modCount++;
int oldCapacity = elementData.length;
if (elementCount < oldCapacity) {
Object oldData[] = elementData;
elementData = new Object[elementCount];
System.arraycopy(oldData, 0, elementData, 0, elementCount);
}
|
private void | writeObject(java.io.ObjectOutputStream s)
s.defaultWriteObject();
|