Package io.github.classgraph
Class PotentiallyUnmodifiableList<T>
java.lang.Object
java.util.AbstractCollection<T>
java.util.AbstractList<T>
java.util.ArrayList<T>
io.github.classgraph.PotentiallyUnmodifiableList<T>
- Type Parameters:
T
- the element type
- All Implemented Interfaces:
Serializable
,Cloneable
,Iterable<T>
,Collection<T>
,List<T>
,RandomAccess
,SequencedCollection<T>
- Direct Known Subclasses:
InfoList
,ResourceList
A potentially unmodifiable list of objects.
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) boolean
Whether or not the list is modifiable.(package private) static final long
serialVersionUID.Fields inherited from class java.util.AbstractList
modCount
-
Constructor Summary
ConstructorsConstructorDescriptionConstructor.PotentiallyUnmodifiableList
(int sizeHint) Constructor.PotentiallyUnmodifiableList
(Collection<T> collection) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoid
boolean
boolean
addAll
(int index, Collection<? extends T> c) boolean
addAll
(Collection<? extends T> c) void
clear()
boolean
int
hashCode()
iterator()
(package private) void
Make this list unmodifiable.remove
(int index) boolean
boolean
removeAll
(Collection<?> c) boolean
retainAll
(Collection<?> c) Methods inherited from class java.util.ArrayList
addFirst, addLast, clone, contains, ensureCapacity, forEach, get, getFirst, getLast, indexOf, isEmpty, lastIndexOf, listIterator, removeFirst, removeIf, removeLast, removeRange, replaceAll, size, sort, spliterator, subList, toArray, toArray, trimToSize
Methods inherited from class java.util.AbstractCollection
containsAll, toString
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Collection
parallelStream, stream, toArray
Methods inherited from interface java.util.List
containsAll, reversed
-
Field Details
-
serialVersionUID
static final long serialVersionUIDserialVersionUID.- See Also:
-
modifiable
boolean modifiableWhether or not the list is modifiable.
-
-
Constructor Details
-
PotentiallyUnmodifiableList
PotentiallyUnmodifiableList()Constructor. -
PotentiallyUnmodifiableList
PotentiallyUnmodifiableList(int sizeHint) Constructor.- Parameters:
sizeHint
- the size hint
-
PotentiallyUnmodifiableList
PotentiallyUnmodifiableList(Collection<T> collection) Constructor.- Parameters:
collection
- the initial elements.
-
-
Method Details
-
equals
-
hashCode
public int hashCode() -
makeUnmodifiable
void makeUnmodifiable()Make this list unmodifiable. -
add
-
add
-
remove
-
remove
-
addAll
-
addAll
-
removeAll
-
retainAll
-
clear
public void clear() -
set
-
iterator
-
listIterator
- Specified by:
listIterator
in interfaceList<T>
- Overrides:
listIterator
in classArrayList<T>
-