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

public Class VectorUtils

extends Object
Class Inheritance
Imports
java.util.Collection, .Collections, .Comparator, .Iterator, .List, .ListIterator, .Objects, .Spliterator, .Spliterators, .Vector, java.util.function.Consumer, .Predicate, .UnaryOperator

This class provides "empty" and "unmodifiable" wrappers for the Vector class. The functionality is similar the Collections class and mostly copy-paste from the class. Unfortunately, the standard Collections class does not provides wrappers for the outdated Vector class.
See Also
Collections

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
pack-priv static class

Field Summary

Modifier and TypeField and Description
public static final Vector<E>
EMPTY_VECTOR

The empty vector (immutable).

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static final <
type of elements, if there were any, in the vector
T
>
Vector<T>

Returns:

an empty immutable vector Implementation Note: Implementations of this method need not create a separate Vector object for each call. Using this method is likely to have comparable cost to using the like-named field. (Unlike this method, the field does not provide type safety.)
emptyVector
()

Returns an empty vector (immutable).

public static <
the class of the objects in the vector
T
>
Vector<T>

Returns:

an unmodifiable view of the specified vector.
unmodifiableVector
(Vector<? extends T>
the vector for which an unmodifiable view is to be returned.
vector
)

Returns an unmodifiable view of the specified vector.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

EMPTY_VECTORback to summary
public static final Vector<E> EMPTY_VECTOR

The empty vector (immutable).

See Also
emptyVector()

Constructor Detail

VectorUtilsback to summary
private VectorUtils()

Method Detail

emptyVectorback to summary
public static final <T> Vector<T> emptyVector()

Returns an empty vector (immutable).

This example illustrates the type-safe way to obtain an empty vector:

    Vector<String> s = VectorUtils.emptyVector();
Parameters
<T>
type of elements, if there were any, in the vector
Returns:Vector<T>

an empty immutable vector Implementation Note: Implementations of this method need not create a separate Vector object for each call. Using this method is likely to have comparable cost to using the like-named field. (Unlike this method, the field does not provide type safety.)

Annotations
@SuppressWarnings:unchecked
See Also
EMPTY_VECTOR
unmodifiableVectorback to summary
public static <T> Vector<T> unmodifiableVector(Vector<? extends T> vector)

Returns an unmodifiable view of the specified vector. This method allows modules to provide users with "read-only" access to internal vectors. Query operations on the returned vector "read through" to the specified vector, and attempts to modify the returned vector, whether direct or via its iterator, result in an UnsupportedOperationException.

Parameters
<T>
the class of the objects in the vector
vector:Vector<? extends T>

the vector for which an unmodifiable view is to be returned.

Returns:Vector<T>

an unmodifiable view of the specified vector.

org.eclipse.persistence.internal.oxm back to summary

private Class VectorUtils.EmptyVector<E>

extends Vector<E>
Class Inheritance

Field Summary

Modifier and TypeField and Description
private static final long
Inherited from java.util.Vector:
capacityIncrementelementCountelementData

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public void
add(int
index at which the specified element is to be inserted
index
,
E
element to be inserted
element
)

Overrides java.util.Vector.add.

Implements java.util.List.add.

Inserts the specified element at the specified position in this Vector.
public boolean
contains(Object
element whose presence in this vector is to be tested
obj
)

Overrides java.util.Vector.contains.

Implements java.util.List.contains, java.util.Collection.contains.

Returns true if this vector contains the specified element.
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 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 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.
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 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 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 Object
public boolean
removeIf(Predicate<? super E>
a predicate which returns true for elements to be removed
filter
)

Overrides java.util.Vector.removeIf.

Overrides default java.util.Collection.removeIf.

Removes all of the elements of this collection that satisfy the given predicate.
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 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 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.
Inherited from java.util.Vector:
addaddAlladdAlladdElementcapacityclearclonecopyIntoelementAtelementsensureCapacityfirstElementindexOfindexOfinsertElementAtlastElementlastIndexOflastIndexOfremoveremoveremoveAllremoveAllElementsremoveElementremoveElementAtremoveRangeretainAllsetsetElementAtsetSizesubListtoStringtrimToSize

Field Detail

serialVersionUIDback to summary
private static final long serialVersionUID

Hides java.util.Vector.serialVersionUID.

Constructor Detail

EmptyVectorback to summary
private EmptyVector()

Method Detail

addback to summary
public void add(int index, E element)

Overrides java.util.Vector.add.

Implements java.util.List.add.

Doc from java.util.Vector.add.

Inserts the specified element at the specified position in this Vector. Shifts the element currently at that position (if any) and any subsequent elements to the right (adds one to their indices).

Parameters
index:int

index at which the specified element is to be inserted

element:E

element to be inserted

Annotations
@Override
containsback to summary
public boolean contains(Object obj)

Overrides java.util.Vector.contains.

Implements java.util.List.contains, java.util.Collection.contains.

Doc from java.util.Vector.contains.

Returns true if this vector contains the specified element. More formally, returns true if and only if this vector contains at least one element e such that Objects.equals(o, e).

Parameters
obj:Object

element whose presence in this vector is to be tested

Returns:boolean

true if this vector contains the specified element

Annotations
@Override
containsAllback to summary
public boolean containsAll(Collection<?> c)

Overrides java.util.Vector.containsAll.

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

Doc from java.util.Vector.containsAll.

Returns true if this Vector contains all of the elements in the specified Collection.

Parameters
c:Collection<?>

a collection whose elements will be tested for containment in this Vector

Returns:boolean

true if this Vector contains all of the elements in the specified collection

Annotations
@Override
equalsback to summary
public boolean equals(Object o)

Overrides java.util.Vector.equals.

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

Doc from java.util.Vector.equals.

Compares the specified Object with this Vector 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 Objects.equals(e1, e2).) In other words, two Lists are defined to be equal if they contain the same elements in the same order.

Parameters
o:Object

the Object to be compared for equality with this Vector

Returns:boolean

true if the specified Object is equal to this Vector

Annotations
@Override
forEachback to summary
public void forEach(Consumer<? super E> action)

Overrides java.util.Vector.forEach.

Overrides default java.lang.Iterable.forEach.

Doc from 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. Actions are performed in the order of iteration, if that order is specified. Exceptions thrown by the action are relayed to the caller.

The behavior of this method is unspecified if the action performs side-effects that modify the underlying source of elements, unless an overriding class has specified a concurrent modification policy.

Parameters
action:Consumer<? super E>

The action to be performed for each element

Annotations
@Override
getback to summary
public E get(int index)

Overrides java.util.Vector.get.

Implements java.util.List.get.

Doc from java.util.Vector.get.

Returns the element at the specified position in this Vector.

Parameters
index:int

index of the element to return

Returns:E

object at the specified index

Annotations
@Override
hashCodeback to summary
public int hashCode()

Overrides java.util.Vector.hashCode.

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

Doc from java.util.Vector.hashCode.

Returns the hash code value for this Vector.

Returns:int

Doc from java.util.List.hashCode.

the hash code value for this list

Annotations
@Override
isEmptyback to summary
public boolean isEmpty()

Overrides java.util.Vector.isEmpty.

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

Doc from java.util.Vector.isEmpty.

Tests if this vector has no components.

Returns:boolean

true if and only if this vector has no components, that is, its size is zero; false otherwise.

Annotations
@Override
iteratorback to summary
public Iterator<E> iterator()

Overrides java.util.Vector.iterator.

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

Doc from java.util.Vector.iterator.

Returns an iterator over the elements in this list in proper sequence.

The returned iterator is fail-fast.

Returns:Iterator<E>

an iterator over the elements in this list in proper sequence

Annotations
@Override
listIteratorback to summary
public ListIterator<E> listIterator(int index)

Overrides java.util.Vector.listIterator.

Implements java.util.List.listIterator.

Doc from java.util.Vector.listIterator.

Returns a list iterator over the elements in this list (in proper sequence), starting at the specified position in the list. The specified index indicates the first element that would be returned by an initial call to next. An initial call to previous would return the element with the specified index minus one.

The returned list iterator is fail-fast.

Parameters
index:int

Doc from java.util.List.listIterator.

index of the first element to be returned from the list iterator (by a call to next)

Returns:ListIterator<E>

Doc from java.util.List.listIterator.

a list iterator over the elements in this list (in proper sequence), starting at the specified position in the list

Annotations
@Override
listIteratorback to summary
public ListIterator<E> listIterator()

Overrides java.util.Vector.listIterator.

Implements java.util.List.listIterator.

Doc from java.util.Vector.listIterator.

Returns a list iterator over the elements in this list (in proper sequence).

The returned list iterator is fail-fast.

Returns:ListIterator<E>

Doc from java.util.List.listIterator.

a list iterator over the elements in this list (in proper sequence)

Annotations
@Override
readResolveback to summary
private Object readResolve()
removeIfback to summary
public boolean removeIf(Predicate<? super E> filter)

Overrides java.util.Vector.removeIf.

Overrides default java.util.Collection.removeIf.

Doc from java.util.Collection.removeIf.

Removes all of the elements of this collection that satisfy the given predicate. Errors or runtime exceptions thrown during iteration or by the predicate are relayed to the caller.

Parameters
filter:Predicate<? super E>

a predicate which returns true for elements to be removed

Returns:boolean

true if any elements were removed

Annotations
@Override
replaceAllback to summary
public void replaceAll(UnaryOperator<E> operator)

Overrides java.util.Vector.replaceAll.

Overrides default java.util.List.replaceAll.

Doc from java.util.List.replaceAll.

Replaces each element of this list with the result of applying the operator to that element. Errors or runtime exceptions thrown by the operator are relayed to the caller.

Parameters
operator:UnaryOperator<E>

the operator to apply to each element

Annotations
@Override
sizeback to summary
public int size()

Overrides java.util.Vector.size.

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

Doc from java.util.Vector.size.

Returns the number of components in this vector.

Returns:int

the number of components in this vector

Annotations
@Override
sortback to summary
public void sort(Comparator<? super E> c)

Overrides java.util.Vector.sort.

Overrides default java.util.List.sort.

Doc from java.util.List.sort.

Sorts this list according to the order induced by the specified Comparator. The sort is stable: this method must not reorder equal elements.

All elements in this list must be mutually comparable using the specified comparator (that is, c.compare(e1, e2) must not throw a ClassCastException for any elements e1 and e2 in the list).

If the specified comparator is null then all elements in this list must implement the Comparable interface and the elements' natural ordering should be used.

This list must be modifiable, but need not be resizable.

Parameters
c:Comparator<? super E>

the Comparator used to compare list elements. A null value indicates that the elements' natural ordering should be used

Annotations
@Override
spliteratorback to summary
public Spliterator<E> spliterator()

Overrides java.util.Vector.spliterator.

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

Doc from java.util.Vector.spliterator.

Creates a late-binding and fail-fast Spliterator over the elements in this list.

The Spliterator reports Spliterator#SIZED, Spliterator#SUBSIZED, and Spliterator#ORDERED. Overriding implementations should document the reporting of additional characteristic values.

Returns:Spliterator<E>

a Spliterator over the elements in this list

Annotations
@Override
toArrayback to summary
public Object[] toArray()

Overrides java.util.Vector.toArray.

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

Doc from java.util.Vector.toArray.

Returns an array containing all of the elements in this Vector in the correct order.

Returns:Object[]

Doc from java.util.List.toArray.

an array containing all of the elements in this list in proper sequence

Annotations
@Override
toArrayback to summary
public <T> T[] toArray(T[] a)

Overrides java.util.Vector.toArray.

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

Doc from java.util.Vector.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. If the Vector fits in the specified array, it is returned therein. Otherwise, a new array is allocated with the runtime type of the specified array and the size of this Vector.

If the Vector fits in the specified array with room to spare (i.e., the array has more elements than the Vector), the element in the array immediately following the end of the Vector is set to null. (This is useful in determining the length of the Vector only if the caller knows that the Vector does not contain any null elements.)

Parameters
<T>
type of array elements. The same type as <E> or a supertype of <E>.
a: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.

Returns:T[]

an array containing the elements of the Vector

Annotations
@Override
org.eclipse.persistence.internal.oxm back to summary

pack-priv Class VectorUtils.UnmodifiableVector<E>

extends Vector<E>
Class Inheritance

Field Summary

Modifier and TypeField and Description
private static final long
Inherited from java.util.Vector:
capacityIncrementelementCountelementData

Constructor Summary

AccessConstructor and Description
pack-priv
UnmodifiableVector(Vector<? extends E> vector)

Method Summary

Modifier and TypeMethod and Description
public void
add(int
index at which the specified element is to be inserted
index
,
E
element to be inserted
element
)

Overrides java.util.Vector.add.

Implements java.util.List.add.

Inserts the specified element at the specified position in this Vector.
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 ListIterator<E>
listIterator(final 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).
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 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 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.
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 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.
Inherited from java.util.Vector:
addaddAlladdElementcapacityclearclonecontainscontainsAllcopyIntoelementAtelementsensureCapacityequalsfirstElementforEachgethashCodeindexOfindexOfinsertElementAtisEmptyiteratorlastElementlastIndexOflastIndexOfremoveremoveAllremoveAllElementsremoveElementremoveElementAtremoveIfremoveRangeretainAllsetElementAtsetSizesizespliteratortoArraytoArraytoStringtrimToSize

Field Detail

serialVersionUIDback to summary
private static final long serialVersionUID

Hides java.util.Vector.serialVersionUID.

Constructor Detail

UnmodifiableVectorback to summary
pack-priv UnmodifiableVector(Vector<? extends E> vector)

Method Detail

addback to summary
public void add(int index, E element)

Overrides java.util.Vector.add.

Implements java.util.List.add.

Doc from java.util.Vector.add.

Inserts the specified element at the specified position in this Vector. Shifts the element currently at that position (if any) and any subsequent elements to the right (adds one to their indices).

Parameters
index:int

index at which the specified element is to be inserted

element:E

element to be inserted

Annotations
@Override
addAllback to summary
public boolean addAll(int index, Collection<? extends E> c)

Overrides java.util.Vector.addAll.

Implements java.util.List.addAll.

Doc from java.util.Vector.addAll.

Inserts all of the elements in the specified Collection into this Vector at the specified position. Shifts the element currently at that position (if any) and any subsequent elements to the right (increases their indices). The new elements will appear in the Vector in the order that they are returned by the specified Collection's iterator.

Parameters
index:int

index at which to insert the first element from the specified collection

c:Collection<? extends E>

elements to be inserted into this Vector

Returns:boolean

true if this Vector changed as a result of the call

Annotations
@Override
listIteratorback to summary
public ListIterator<E> listIterator(final int index)

Overrides java.util.Vector.listIterator.

Implements java.util.List.listIterator.

Doc from java.util.Vector.listIterator.

Returns a list iterator over the elements in this list (in proper sequence), starting at the specified position in the list. The specified index indicates the first element that would be returned by an initial call to next. An initial call to previous would return the element with the specified index minus one.

The returned list iterator is fail-fast.

Parameters
index:int

Doc from java.util.List.listIterator.

index of the first element to be returned from the list iterator (by a call to next)

Returns:ListIterator<E>

Doc from java.util.List.listIterator.

a list iterator over the elements in this list (in proper sequence), starting at the specified position in the list

Annotations
@Override
listIteratorback to summary
public ListIterator<E> listIterator()

Overrides java.util.Vector.listIterator.

Implements java.util.List.listIterator.

Doc from java.util.Vector.listIterator.

Returns a list iterator over the elements in this list (in proper sequence).

The returned list iterator is fail-fast.

Returns:ListIterator<E>

Doc from java.util.List.listIterator.

a list iterator over the elements in this list (in proper sequence)

Annotations
@Override
removeback to summary
public E remove(int index)

Overrides java.util.Vector.remove.

Implements java.util.List.remove.

Doc from java.util.Vector.remove.

Removes the element at the specified position in this Vector. Shifts any subsequent elements to the left (subtracts one from their indices). Returns the element that was removed from the Vector.

Parameters
index:int

the index of the element to be removed

Returns:E

element that was removed

Annotations
@Override
replaceAllback to summary
public void replaceAll(UnaryOperator<E> operator)

Overrides java.util.Vector.replaceAll.

Overrides default java.util.List.replaceAll.

Doc from java.util.List.replaceAll.

Replaces each element of this list with the result of applying the operator to that element. Errors or runtime exceptions thrown by the operator are relayed to the caller.

Parameters
operator:UnaryOperator<E>

the operator to apply to each element

Annotations
@Override
setback to summary
public E set(int index, E element)

Overrides java.util.Vector.set.

Implements java.util.List.set.

Doc from java.util.Vector.set.

Replaces the element at the specified position in this Vector with the specified element.

Parameters
index:int

index of the element to replace

element:E

element to be stored at the specified position

Returns:E

the element previously at the specified position

Annotations
@Override
sortback to summary
public void sort(Comparator<? super E> c)

Overrides java.util.Vector.sort.

Overrides default java.util.List.sort.

Doc from java.util.List.sort.

Sorts this list according to the order induced by the specified Comparator. The sort is stable: this method must not reorder equal elements.

All elements in this list must be mutually comparable using the specified comparator (that is, c.compare(e1, e2) must not throw a ClassCastException for any elements e1 and e2 in the list).

If the specified comparator is null then all elements in this list must implement the Comparable interface and the elements' natural ordering should be used.

This list must be modifiable, but need not be resizable.

Parameters
c:Comparator<? super E>

the Comparator used to compare list elements. A null value indicates that the elements' natural ordering should be used

Annotations
@Override
subListback to summary
public List<E> subList(int fromIndex, int toIndex)

Overrides java.util.Vector.subList.

Implements java.util.List.subList.

Doc from java.util.Vector.subList.

Returns a view of the portion of this List between fromIndex, inclusive, and toIndex, exclusive. (If fromIndex and toIndex are equal, the returned List is empty.) The returned List is backed by this List, so changes in the returned List are reflected in this List, and vice-versa. The returned List supports all of the optional List operations supported by this List.

This method eliminates the need for explicit range operations (of the sort that commonly exist for arrays). Any operation that expects a List can be used as a range operation by operating on a subList view instead of a whole List. For example, the following idiom removes a range of elements from a List:

     list.subList(from, to).clear();
Similar idioms may be constructed for indexOf and lastIndexOf, and all of the algorithms in the Collections class can be applied to a subList.

The semantics of the List returned by this method become undefined if the backing list (i.e., this List) is structurally modified in any way other than via the returned List. (Structural modifications are those that change the size of the List, or otherwise perturb it in such a fashion that iterations in progress may yield incorrect results.)

Parameters
fromIndex:int

low endpoint (inclusive) of the subList

toIndex:int

high endpoint (exclusive) of the subList

Returns:List<E>

a view of the specified range within this List

Annotations
@Override