Package com.strobel.core
Class ReadOnlyList<T>
java.lang.Object
com.strobel.core.ReadOnlyList<T>
- All Implemented Interfaces:
IReadOnlyList<T>
,Iterable<T>
,Collection<T>
,List<T>
,RandomAccess
,SequencedCollection<T>
- Direct Known Subclasses:
MemberList
,ParameterList
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final T[]
private final int
private final int
private static final ReadOnlyList
<?> private static final ReadOnlyList.ReadOnlyCollectionIterator
<?> -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
ReadOnlyList
(ReadOnlyList<T> baseList, int offset, int length) ReadOnlyList
(Class<? extends T> elementType, Collection<? extends T> elements) ReadOnlyList
(T... elements) ReadOnlyList
(T[] elements, int offset, int length) -
Method Summary
Modifier and TypeMethodDescriptionfinal void
final boolean
final boolean
addAll
(int index, Collection<? extends T> c) final boolean
addAll
(Collection<? extends T> c) final void
clear()
final boolean
boolean
containsAll
(Iterable<? extends T> c) final boolean
containsAll
(Collection<?> c) static <T> ReadOnlyList
<T> boolean
final T
get
(int index) protected final T[]
protected final int
int
hashCode()
final int
final boolean
isEmpty()
iterator()
final int
final ListIterator
<T> final ListIterator
<T> listIterator
(int index) protected ReadOnlyList
<T> final T
remove
(int index) final boolean
final boolean
removeAll
(Collection<?> c) final boolean
retainAll
(Collection<?> c) final T
final int
size()
subList
(int fromIndex, int toIndex) protected static void
subListRangeCheck
(int fromIndex, int toIndex, int size) final T[]
toArray()
final <U> U[]
toArray
(U[] a) 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, toArray
Methods inherited from interface java.util.List
addFirst, addLast, getFirst, getLast, removeFirst, removeLast, replaceAll, reversed, sort, spliterator
-
Field Details
-
EMPTY
-
EMPTY_ITERATOR
-
_offset
private final int _offset -
_length
private final int _length -
_elements
-
-
Constructor Details
-
ReadOnlyList
-
ReadOnlyList
-
ReadOnlyList
-
ReadOnlyList
-
-
Method Details
-
emptyList
-
newInstance
-
getOffset
protected final int getOffset() -
getElements
-
size
public final int size()- Specified by:
size
in interfaceCollection<T>
- Specified by:
size
in interfaceIReadOnlyList<T>
- Specified by:
size
in interfaceList<T>
-
isEmpty
public final boolean isEmpty()- Specified by:
isEmpty
in interfaceCollection<T>
- Specified by:
isEmpty
in interfaceIReadOnlyList<T>
- Specified by:
isEmpty
in interfaceList<T>
-
containsAll
- Specified by:
containsAll
in interfaceIReadOnlyList<T>
-
contains
- Specified by:
contains
in interfaceCollection<T>
- Specified by:
contains
in interfaceIReadOnlyList<T>
- Specified by:
contains
in interfaceList<T>
-
iterator
-
toArray
- Specified by:
toArray
in interfaceCollection<T>
- Specified by:
toArray
in interfaceIReadOnlyList<T>
- Specified by:
toArray
in interfaceList<T>
-
toArray
- Specified by:
toArray
in interfaceCollection<T>
- Specified by:
toArray
in interfaceIReadOnlyList<T>
- Specified by:
toArray
in interfaceList<T>
-
add
-
remove
-
containsAll
- Specified by:
containsAll
in interfaceCollection<T>
- Specified by:
containsAll
in interfaceList<T>
-
addAll
-
addAll
-
removeAll
-
retainAll
-
clear
public final void clear() -
get
-
set
-
add
-
remove
-
hashCode
public int hashCode() -
equals
-
indexOf
-
lastIndexOf
- Specified by:
lastIndexOf
in interfaceIReadOnlyList<T>
- Specified by:
lastIndexOf
in interfaceList<T>
-
toString
-
listIterator
- Specified by:
listIterator
in interfaceIReadOnlyList<T>
- Specified by:
listIterator
in interfaceList<T>
-
listIterator
- Specified by:
listIterator
in interfaceIReadOnlyList<T>
- Specified by:
listIterator
in interfaceList<T>
-
subListRangeCheck
protected static void subListRangeCheck(int fromIndex, int toIndex, int size) -
subList
-