public class ImmutableIntList extends FlatLists.AbstractFlatList<Integer>
Integer values backed by an array of
ints.| Modifier and Type | Class and Description |
|---|---|
private static class |
ImmutableIntList.AbstractIndexedListIterator<E>
Extension to
UnmodifiableListIterator
that operates by index. |
private static class |
ImmutableIntList.EmptyImmutableIntList
Special sub-class of
ImmutableIntList that is always
empty and has only one instance. |
| Modifier and Type | Field and Description |
|---|---|
private static ImmutableIntList |
EMPTY |
private static Object[] |
EMPTY_ARRAY |
private int[] |
ints |
| Modifier | Constructor and Description |
|---|---|
private |
ImmutableIntList(int... ints) |
| Modifier and Type | Method and Description |
|---|---|
ImmutableIntList |
append(int element)
Returns a copy of this list with one element added.
|
ImmutableIntList |
append(Integer e)
Returns a list that consists of a this list's elements plus a given
element.
|
private static ImmutableIntList |
copyFromCollection(Collection<? extends Number> list) |
static ImmutableIntList |
copyOf(Iterable<? extends Number> list)
Creates an ImmutableIntList from an iterable of
Number. |
static ImmutableIntList |
copyOf(Iterator<? extends Number> list)
Creates an ImmutableIntList from an iterator of
Number. |
static ImmutableIntList |
copyOf(Number... numbers)
Creates an ImmutableIntList from an array of
Number. |
boolean |
equals(Object obj) |
Integer |
get(int index) |
int |
getInt(int index) |
int |
hashCode() |
static ImmutableIntList |
identity(int count)
Returns the identity list [0, ..., count - 1].
|
int |
indexOf(int seek) |
int |
indexOf(Object o) |
boolean |
isEmpty() |
Iterator<Integer> |
iterator() |
int |
lastIndexOf(int seek) |
int |
lastIndexOf(Object o) |
ListIterator<Integer> |
listIterator() |
ListIterator<Integer> |
listIterator(int index) |
static ImmutableIntList |
of()
Returns an empty ImmutableIntList.
|
static ImmutableIntList |
of(int... ints)
Creates an ImmutableIntList from an array of
int. |
static List<Integer> |
range(int lower,
int upper)
Returns a list that contains the values lower to upper - 1.
|
int |
size() |
Object[] |
toArray() |
<T> T[] |
toArray(T[] a) |
int[] |
toIntArray()
Returns an array of
ints with the same contents as this list. |
String |
toString() |
toListadd, add, addAll, addAll, clear, contains, containsAll, remove, remove, removeAll, retainAll, set, subListclone, finalize, getClass, notify, notifyAll, wait, wait, waitreplaceAll, sort, spliteratorparallelStream, removeIf, streamprivate final int[] ints
private static final Object[] EMPTY_ARRAY
private static final ImmutableIntList EMPTY
public static ImmutableIntList of()
public static ImmutableIntList of(int... ints)
int.public static ImmutableIntList copyOf(Number... numbers)
Number.public static ImmutableIntList copyOf(Iterable<? extends Number> list)
Number.public static ImmutableIntList copyOf(Iterator<? extends Number> list)
Number.private static ImmutableIntList copyFromCollection(Collection<? extends Number> list)
public int hashCode()
public boolean equals(Object obj)
public boolean isEmpty()
isEmpty in interface Collection<Integer>isEmpty in interface List<Integer>isEmpty in class AbstractImmutableList<Integer>public int size()
public Object[] toArray()
public <T> T[] toArray(T[] a)
public int[] toIntArray()
ints with the same contents as this list.public Integer get(int index)
public int getInt(int index)
public ListIterator<Integer> listIterator()
listIterator in interface List<Integer>listIterator in class AbstractImmutableList<Integer>public ListIterator<Integer> listIterator(int index)
listIterator in interface List<Integer>listIterator in class AbstractImmutableList<Integer>public int indexOf(Object o)
public int indexOf(int seek)
public int lastIndexOf(Object o)
public int lastIndexOf(int seek)
public ImmutableIntList append(Integer e)
FlatLists.AbstractFlatListappend in class FlatLists.AbstractFlatList<Integer>public ImmutableIntList append(int element)
public static List<Integer> range(int lower, int upper)
For example, range(1, 3) contains [1, 2].
public static ImmutableIntList identity(int count)
Mappings.isIdentity(List, int)Copyright © 2012–2018 The Apache Software Foundation. All rights reserved.