Package com.sun.javafx
Class UnmodifiableArrayList<T>
java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractList<T>
com.sun.javafx.UnmodifiableArrayList<T>
- All Implemented Interfaces:
Iterable<T>
,Collection<T>
,List<T>
,RandomAccess
An unmodifiable array-based List implementation. This is essentially like the
package private UnmodifiableRandomAccessList of the JDK, and helps us to
avoid having to do a lot of conversion work when we want to pass an array
into an unmodifiable list implementation (otherwise we would have to create
a temporary list that is then passed to Collections.unmodifiableList).
-
Field Summary
Fields inherited from class java.util.AbstractList
modCount
-
Constructor Summary
ConstructorDescriptionUnmodifiableArrayList
(T[] elements, int size) The given elements are used directly (a defensive copy is not made), and the given size is used as the size of this list. -
Method Summary
Methods inherited from class java.util.AbstractList
add, add, addAll, clear, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, remove, removeRange, set, subList
Methods inherited from class java.util.AbstractCollection
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toString
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream
Methods inherited from interface java.util.List
addAll, contains, containsAll, isEmpty, remove, removeAll, replaceAll, retainAll, sort, spliterator, toArray, toArray
-
Constructor Details
-
UnmodifiableArrayList
The given elements are used directly (a defensive copy is not made), and the given size is used as the size of this list. It is the callers responsibility to make sure the size is accurate.- Parameters:
elements
- The elements to use.size
- The size must be invalid input: '<'= the length of the elements array
-
-
Method Details
-
get
-
size
public int size()- Specified by:
size
in interfaceCollection<T>
- Specified by:
size
in interfaceList<T>
- Specified by:
size
in classAbstractCollection<T>
-