Package com.google.common.collect
Class ImmutableList.SubList
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- com.google.common.collect.ImmutableCollection<E>
-
- com.google.common.collect.ImmutableList<E>
-
- com.google.common.collect.ImmutableList.SubList
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Iterable<E>
,java.util.Collection<E>
,java.util.List<E>
,java.util.RandomAccess
- Enclosing class:
- ImmutableList<E>
class ImmutableList.SubList extends ImmutableList<E>
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.google.common.collect.ImmutableList
ImmutableList.Builder<E>, ImmutableList.SerializedForm, ImmutableList.SubList
-
Nested classes/interfaces inherited from class com.google.common.collect.ImmutableCollection
ImmutableCollection.ArrayBasedBuilder<E>
-
-
Constructor Summary
Constructors Constructor Description SubList(int offset, int length)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description E
get(int index)
(package private) boolean
isPartialView()
Returnstrue
if this immutable collection's implementation contains references to user-created objects that aren't accessible via this collection's methods.int
size()
ImmutableList<E>
subList(int fromIndex, int toIndex)
Returns an immutable list of the elements between the specifiedfromIndex
, inclusive, andtoIndex
, exclusive.-
Methods inherited from class com.google.common.collect.ImmutableList
add, addAll, asImmutableList, asImmutableList, asList, builder, contains, copyIntoArray, copyOf, copyOf, copyOf, copyOf, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, of, of, of, of, of, of, of, of, of, of, of, of, of, remove, reverse, set, subListUnchecked, writeReplace
-
Methods inherited from class com.google.common.collect.ImmutableCollection
add, addAll, clear, remove, removeAll, retainAll, toArray, toArray
-
-
-
-
Method Detail
-
size
public int size()
-
get
public E get(int index)
-
subList
public ImmutableList<E> subList(int fromIndex, int toIndex)
Description copied from class:ImmutableList
Returns an immutable list of the elements between the specifiedfromIndex
, inclusive, andtoIndex
, exclusive. (IffromIndex
andtoIndex
are equal, the empty immutable list is returned.)- Specified by:
subList
in interfacejava.util.List<E>
- Overrides:
subList
in classImmutableList<E>
-
isPartialView
boolean isPartialView()
Description copied from class:ImmutableCollection
Returnstrue
if this immutable collection's implementation contains references to user-created objects that aren't accessible via this collection's methods. This is generally used to determine whethercopyOf
implementations should make an explicit copy to avoid memory leaks.- Specified by:
isPartialView
in classImmutableCollection<E>
-
-