Top Description Inners Fields Constructors Methods
org.eclipse.persistence.internal.helper

public Class NonSynchronizedVector<E>

extends Vector<E>
Class Inheritance
Known Direct Subclasses
org.eclipse.persistence.internal.helper.NonSynchronizedSubVector
Imports
java.io.IOException, .ObjectInputStream, .StreamCorruptedException, java.util.*, java.util.function.Consumer, .Predicate, .UnaryOperator

Vector subclass that removes the synchronization.

Nested and Inner Type Summary

Modifier and TypeClass and Description
private class
pack-priv class
NonSynchronizedVector.ListItr

An optimized version of AbstractList.ListItr

pack-priv class
NonSynchronizedVector.VectorSpliterator

Similar to ArrayList Spliterator

Field Summary

Inherited from java.util.Vector:
capacityIncrementelementCountelementData

Constructor Summary

AccessConstructor and Description
public
NonSynchronizedVector(int initialCapacity, int capacityIncrement)

public
NonSynchronizedVector(int initialCapacity)

public
public

Method Summary

Modifier and TypeMethod and Description
private void
add(E e, Object[] elementData, int s)

Hides java.util.Vector.add.

This helper method split out from add(E) to keep method bytecode size under 35 (the -XX:MaxInlineSize default value), which helps when add(E) is called in a C1-compiled loop.
public boolean
add(E
element to be appended to this Vector
o
)

Overrides java.util.Vector.add.

Implements java.util.List.add, java.util.Collection.add.

Appends the specified element to the end of this Vector.
public boolean
addAll(Collection<? extends E>
elements to be inserted into this Vector
c
)

Overrides java.util.Vector.addAll.

Implements java.util.List.addAll, java.util.Collection.addAll.

Appends all of the elements in the specified Collection to the end of this Vector, in the order that they are returned by the specified Collection's Iterator.
public boolean
addAll(int
index at which to insert the first element from the specified collection
index
,
Collection<? extends E>
elements to be inserted into this Vector
c
)

Overrides java.util.Vector.addAll.

Implements java.util.List.addAll.

Inserts all of the elements in the specified Collection into this Vector at the specified position.
public void
addElement(E
the component to be added
obj
)

Overrides java.util.Vector.addElement.

Adds the specified component to the end of this vector, increasing its size by one.
private boolean
public int
capacity()

Overrides java.util.Vector.capacity.

Returns the current capacity of this vector.
public Object
clone()

Overrides java.util.Vector.clone.

Returns a clone of this vector.
public boolean
containsAll(Collection<?>
a collection whose elements will be tested for containment in this Vector
c
)

Overrides java.util.Vector.containsAll.

Implements java.util.List.containsAll, java.util.Collection.containsAll.

Returns true if this Vector contains all of the elements in the specified Collection.
public void
copyInto(Object[]
the array into which the components get copied
anArray
)

Overrides java.util.Vector.copyInto.

Copies the components of this vector into the specified array.
public E
elementAt(int
an index into this vector
index
)

Overrides java.util.Vector.elementAt.

Returns the component at the specified index.
pack-priv static <E> E
pack-priv E
public Enumeration<E>
elements()

Overrides java.util.Vector.elements.

Returns an enumeration of the components of this vector.
public void
ensureCapacity(int
the desired minimum capacity
minCapacity
)

Overrides java.util.Vector.ensureCapacity.

Increases the capacity of this vector, if necessary, to ensure that it can hold at least the number of components specified by the minimum capacity argument.
public boolean
equals(Object
the Object to be compared for equality with this Vector
o
)

Overrides java.util.Vector.equals.

Implements java.util.List.equals, java.util.Collection.equals.

Compares the specified Object with this Vector for equality.
public E
firstElement()

Overrides java.util.Vector.firstElement.

Returns the first component (the item at index 0) of this vector.
public void
forEach(Consumer<? super E>
The action to be performed for each element
action
)

Overrides java.util.Vector.forEach.

Overrides default java.lang.Iterable.forEach.

Performs the given action for each element of the Iterable until all elements have been processed or the action throws an exception.
public E
get(int
index of the element to return
index
)

Overrides java.util.Vector.get.

Implements java.util.List.get.

Returns the element at the specified position in this Vector.
private Object[]
grow(int
the desired minimum capacity
minCapacity
)

Hides java.util.Vector.grow.

Increases the capacity to ensure that it can hold at least the number of elements specified by the minimum capacity argument.
private Object[]
public int
hashCode()

Overrides java.util.Vector.hashCode.

Implements java.util.List.hashCode, java.util.Collection.hashCode.

Returns the hash code value for this Vector.
public int
indexOf(Object
element to search for
elem
,
int
index to start searching from
index
)

Overrides java.util.Vector.indexOf.

Returns the index of the first occurrence of the specified element in this vector, searching forwards from index, or returns -1 if the element is not found.
public void
insertElementAt(E
the component to insert
obj
,
int
where to insert the new component
index
)

Overrides java.util.Vector.insertElementAt.

Inserts the specified object as a component in this vector at the specified index.
private static boolean
isClear(long[] bits, int i)

Hides java.util.Vector.isClear.

public boolean
isEmpty()

Overrides java.util.Vector.isEmpty.

Implements java.util.List.isEmpty, java.util.Collection.isEmpty.

Tests if this vector has no components.
public Iterator<E>
iterator()

Overrides java.util.Vector.iterator.

Implements java.util.List.iterator, java.util.Collection.iterator.

Returns an iterator over the elements in this list in proper sequence.
public E
lastElement()

Overrides java.util.Vector.lastElement.

Returns the last component of the vector.
public int
lastIndexOf(Object
element to search for
elem
)

Overrides java.util.Vector.lastIndexOf.

Implements java.util.List.lastIndexOf.

Returns the index of the last occurrence of the specified element in this vector, or -1 if this vector does not contain the element.
public int
lastIndexOf(Object
element to search for
elem
,
int
index to start searching backwards from
index
)

Overrides java.util.Vector.lastIndexOf.

Returns the index of the last occurrence of the specified element in this vector, searching backwards from index, or returns -1 if the element is not found.
public ListIterator<E>
listIterator(int
index of the first element to be returned from the list iterator (by a call to next)
index
)

Overrides java.util.Vector.listIterator.

Implements java.util.List.listIterator.

Returns a list iterator over the elements in this list (in proper sequence), starting at the specified position in the list.
public ListIterator<E>
listIterator()

Overrides java.util.Vector.listIterator.

Implements java.util.List.listIterator.

Returns a list iterator over the elements in this list (in proper sequence).
private static long[]
public static <E> NonSynchronizedVector<E>
newInstance(int initialCapacity, int capacityIncrement)

public static <E> NonSynchronizedVector<E>
newInstance(int initialCapacity)

public static <E> NonSynchronizedVector<E>
public static <E> NonSynchronizedVector<E>
newInstance(Collection<? extends E> c)

private int
newLength(int oldLength, int minGrowth, int prefGrowth)

private void
readObject(ObjectInputStream
the stream
in
)

Hides java.util.Vector.readObject.

Loads a Vector instance from a stream (that is, deserializes it).
public E
remove(int
the index of the element to be removed
index
)

Overrides java.util.Vector.remove.

Implements java.util.List.remove.

Removes the element at the specified position in this Vector.
public boolean
removeAll(Collection<?>
a collection of elements to be removed from the Vector
c
)

Overrides java.util.Vector.removeAll.

Implements java.util.List.removeAll, java.util.Collection.removeAll.

Removes from this Vector all of its elements that are contained in the specified Collection.
public void
removeAllElements()

Overrides java.util.Vector.removeAllElements.

Removes all components from this vector and sets its size to zero.
public boolean
removeElement(Object
the component to be removed
obj
)

Overrides java.util.Vector.removeElement.

Removes the first (lowest-indexed) occurrence of the argument from this vector.
public void
removeElementAt(int
the index of the object to remove
index
)

Overrides java.util.Vector.removeElementAt.

Deletes the component at the specified index.
protected void
removeRange(int
index of first element to be removed
fromIndex
,
int
index after last element to be removed
toIndex
)

Overrides java.util.Vector.removeRange.

Removes from this list all of the elements whose index is between fromIndex, inclusive, and toIndex, exclusive.
public void
replaceAll(UnaryOperator<E>
the operator to apply to each element
operator
)

Overrides java.util.Vector.replaceAll.

Overrides default java.util.List.replaceAll.

Replaces each element of this list with the result of applying the operator to that element.
public boolean
retainAll(Collection<?>
a collection of elements to be retained in this Vector (all other elements are removed)
c
)

Overrides java.util.Vector.retainAll.

Implements java.util.List.retainAll, java.util.Collection.retainAll.

Retains only the elements in this Vector that are contained in the specified Collection.
public E
set(int
index of the element to replace
index
,
E
element to be stored at the specified position
element
)

Overrides java.util.Vector.set.

Implements java.util.List.set.

Replaces the element at the specified position in this Vector with the specified element.
private static void
setBit(long[] bits, int i)

Hides java.util.Vector.setBit.

public void
setElementAt(E
what the component is to be set to
obj
,
int
the specified index
index
)

Overrides java.util.Vector.setElementAt.

Sets the component at the specified index of this vector to be the specified object.
public void
setSize(int
the new size of this vector
newSize
)

Overrides java.util.Vector.setSize.

Sets the size of this vector.
private void
shiftTailOverGap(Object[] es, int lo, int hi)

Hides java.util.Vector.shiftTailOverGap.

Erases the gap from lo to hi, by sliding down following elements.
public int
size()

Overrides java.util.Vector.size.

Implements java.util.List.size, java.util.Collection.size.

Returns the number of components in this vector.
public void
sort(Comparator<? super E>
the Comparator used to compare list elements. A null value indicates that the elements' natural ordering should be used
c
)

Overrides java.util.Vector.sort.

Overrides default java.util.List.sort.

Sorts this list according to the order induced by the specified Comparator.
public Spliterator<E>
spliterator()

Overrides java.util.Vector.spliterator.

Overrides default java.util.List.spliterator, java.util.Collection.spliterator.

Creates a late-binding and fail-fast Spliterator over the elements in this list.
public List<E>
subList(int
low endpoint (inclusive) of the subList
fromIndex
,
int
high endpoint (exclusive) of the subList
toIndex
)

Overrides java.util.Vector.subList.

Implements java.util.List.subList.

Returns a view of the portion of this List between fromIndex, inclusive, and toIndex, exclusive.
public Object[]
toArray()

Overrides java.util.Vector.toArray.

Implements java.util.List.toArray, java.util.Collection.toArray.

Returns an array containing all of the elements in this Vector in the correct order.
public <T> T[]
toArray(T[]
the array into which the elements of the Vector are to be stored, if it is big enough; otherwise, a new array of the same runtime type is allocated for this purpose.
a
)

Overrides java.util.Vector.toArray.

Implements java.util.List.toArray, java.util.Collection.toArray.

Returns an array containing all of the elements in this Vector in the correct order; the runtime type of the returned array is that of the specified array.
public String
toString()

Overrides java.util.Vector.toString.

Returns a string representation of this Vector, containing the String representation of each element.
public void
trimToSize()

Overrides java.util.Vector.trimToSize.

Trims the capacity of this vector to be the vector's current size.
private void
writeObject(ObjectOutputStream
the stream
s
)

Hides java.util.Vector.writeObject.

Saves the state of the Vector instance to a stream (that is, serializes it).
Inherited from java.util.Vector:
addclearcontainsindexOfremoveremoveIf