Package org.apache.calcite.util
Class ImmutableIntList
java.lang.Object
org.apache.calcite.runtime.FlatLists.AbstractFlatList<Integer>
org.apache.calcite.util.ImmutableIntList
- All Implemented Interfaces:
Iterable<Integer>,Collection<Integer>,List<Integer>,RandomAccess
An immutable list of
Integer values backed by an array of
ints.-
Method Summary
Modifier and TypeMethodDescriptionvoidbooleanbooleanaddAll(int index, Collection<? extends Integer> c) booleanaddAll(Collection<? extends Integer> c) append(int element) Returns a copy of this list with one element added.Returns a list that consists of a this list's elements plus a given element.Returns a copy of this list with all of the given integers added.voidclear()booleanbooleancontainsAll(Collection<?> c) static ImmutableIntListcopyOf(int... ints) Same asof(int...), but less ambiguous for code generators and compilers.static ImmutableIntListCreates an ImmutableIntList from an iterable ofNumber.static ImmutableIntListCreates an ImmutableIntList from an array ofNumber.static ImmutableIntListCreates an ImmutableIntList from an iterator ofNumber.booleanvoidvoidforEachInt(IntConsumer action) AsforEach(Consumer)but on primitiveintvalues.get(int index) intgetInt(int index) inthashCode()static ImmutableIntListidentity(int count) Returns the identity list [0, ..., count - 1].incr(int offset) Incrementsoffsetto each element of the list and returns a new int list.intindexOf(int seek) intbooleanisEmpty()iterator()intlastIndexOf(int seek) intlastIndexOf(@Nullable Object o) listIterator(int index) static ImmutableIntListof()Returns an empty ImmutableIntList.static ImmutableIntListof(int... ints) Creates an ImmutableIntList from an array ofint.range(int lower, int upper) Returns a list that contains the values lower to upper - 1.remove(int index) booleanbooleanremoveAll(Collection<?> c) booleanretainAll(Collection<?> c) intsize()subList(int fromIndex, int toIndex) Object[]toArray()<T> @Nullable T[]toArray(T @Nullable [] a) int[]Returns an array ofints with the same contents as this list.Returns a List ofInteger.toString()Methods inherited from class org.apache.calcite.runtime.FlatLists.AbstractFlatList
toListMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArrayMethods inherited from interface java.util.List
replaceAll, sort, spliterator
-
Method Details
-
of
Returns an empty ImmutableIntList. -
of
Creates an ImmutableIntList from an array ofint. -
copyOf
Same asof(int...), but less ambiguous for code generators and compilers. -
copyOf
Creates an ImmutableIntList from an array ofNumber. -
copyOf
Creates an ImmutableIntList from an iterable ofNumber. -
copyOf
Creates an ImmutableIntList from an iterator ofNumber. -
hashCode
public int hashCode() -
equals
-
toString
-
isEmpty
public boolean isEmpty() -
size
public int size() -
forEach
-
forEachInt
AsforEach(Consumer)but on primitiveintvalues. -
toArray
-
toArray
public <T> @Nullable T[] toArray(T @Nullable [] a) -
toIntArray
public int[] toIntArray()Returns an array ofints with the same contents as this list. -
toIntegerList
Returns a List ofInteger. -
get
-
getInt
public int getInt(int index) -
iterator
-
listIterator
- Specified by:
listIteratorin interfaceList<Integer>
-
listIterator
- Specified by:
listIteratorin interfaceList<Integer>
-
indexOf
-
indexOf
public int indexOf(int seek) -
lastIndexOf
-
lastIndexOf
public int lastIndexOf(int seek) -
append
Description copied from class:FlatLists.AbstractFlatListReturns a list that consists of a this list's elements plus a given element.- Specified by:
appendin classFlatLists.AbstractFlatList<Integer>
-
append
Returns a copy of this list with one element added. -
range
Returns a list that contains the values lower to upper - 1.For example,
range(1, 3)contains [1, 2]. -
identity
Returns the identity list [0, ..., count - 1].- See Also:
-
appendAll
Returns a copy of this list with all of the given integers added. -
incr
Incrementsoffsetto each element of the list and returns a new int list. -
add
- Specified by:
addin interfaceCollection<E>- Specified by:
addin interfaceList<E>
-
addAll
- Specified by:
addAllin interfaceCollection<E>- Specified by:
addAllin interfaceList<E>
-
addAll
-
removeAll
- Specified by:
removeAllin interfaceCollection<E>- Specified by:
removeAllin interfaceList<E>
-
retainAll
- Specified by:
retainAllin interfaceCollection<E>- Specified by:
retainAllin interfaceList<E>
-
clear
public void clear()- Specified by:
clearin interfaceCollection<E>- Specified by:
clearin interfaceList<E>
-
set
-
add
-
remove
-
subList
-
contains
- Specified by:
containsin interfaceCollection<E>- Specified by:
containsin interfaceList<E>
-
containsAll
- Specified by:
containsAllin interfaceCollection<E>- Specified by:
containsAllin interfaceList<E>
-
remove
- Specified by:
removein interfaceCollection<E>- Specified by:
removein interfaceList<E>
-