Package com.google.common.collect
Class ImmutableAsList<E>
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- com.google.common.collect.ImmutableCollection<E>
-
- com.google.common.collect.ImmutableList<E>
-
- com.google.common.collect.ImmutableAsList<E>
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Iterable<E>,java.util.Collection<E>,java.util.List<E>,java.util.RandomAccess
- Direct Known Subclasses:
RegularImmutableAsList
@GwtCompatible(serializable=true, emulated=true) abstract class ImmutableAsList<E> extends ImmutableList<E>
List returned byImmutableCollection.asList()that delegatescontainschecks to the backing collection.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static classImmutableAsList.SerializedFormSerialized form that leads to the same performance as the original list.-
Nested classes/interfaces inherited from class com.google.common.collect.ImmutableList
ImmutableList.Builder<E>, ImmutableList.SubList
-
-
Field Summary
-
Fields inherited from class com.google.common.collect.ImmutableCollection
SPLITERATOR_CHARACTERISTICS
-
-
Constructor Summary
Constructors Constructor Description ImmutableAsList()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description booleancontains(java.lang.Object target)(package private) abstract ImmutableCollection<E>delegateCollection()booleanisEmpty()(package private) booleanisPartialView()Returnstrueif this immutable collection's implementation contains references to user-created objects that aren't accessible via this collection's methods.private voidreadObject(java.io.ObjectInputStream stream)intsize()(package private) java.lang.ObjectwriteReplace()-
Methods inherited from class com.google.common.collect.ImmutableList
add, addAll, asImmutableList, asImmutableList, asList, builder, builderWithExpectedSize, copyIntoArray, copyOf, copyOf, copyOf, copyOf, equals, forEach, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, of, of, of, of, of, of, of, of, of, of, of, of, of, remove, replaceAll, reverse, set, sort, sortedCopyOf, sortedCopyOf, spliterator, subList, subListUnchecked, toImmutableList
-
Methods inherited from class com.google.common.collect.ImmutableCollection
add, addAll, clear, internalArray, internalArrayEnd, internalArrayStart, remove, removeAll, removeIf, retainAll, toArray, toArray
-
-
-
-
Method Detail
-
delegateCollection
abstract ImmutableCollection<E> delegateCollection()
-
contains
public boolean contains(java.lang.Object target)
- Specified by:
containsin interfacejava.util.Collection<E>- Specified by:
containsin interfacejava.util.List<E>- Overrides:
containsin classImmutableList<E>
-
size
public int size()
-
isEmpty
public boolean isEmpty()
-
isPartialView
boolean isPartialView()
Description copied from class:ImmutableCollectionReturnstrueif 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 whethercopyOfimplementations should make an explicit copy to avoid memory leaks.- Specified by:
isPartialViewin classImmutableCollection<E>
-
readObject
@GwtIncompatible private void readObject(java.io.ObjectInputStream stream) throws java.io.InvalidObjectException
- Throws:
java.io.InvalidObjectException
-
writeReplace
@GwtIncompatible java.lang.Object writeReplace()
- Overrides:
writeReplacein classImmutableList<E>
-
-