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
int
s.-
Method Summary
Modifier and TypeMethodDescriptionvoid
boolean
boolean
addAll
(int index, Collection<? extends Integer> c) boolean
addAll
(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.void
clear()
boolean
boolean
containsAll
(Collection<?> c) static ImmutableIntList
copyOf
(int... ints) Same asof(int...)
, but less ambiguous for code generators and compilers.static ImmutableIntList
Creates an ImmutableIntList from an iterable ofNumber
.static ImmutableIntList
Creates an ImmutableIntList from an array ofNumber
.static ImmutableIntList
Creates an ImmutableIntList from an iterator ofNumber
.boolean
void
void
forEachInt
(IntConsumer action) AsforEach(Consumer)
but on primitiveint
values.get
(int index) int
getInt
(int index) int
hashCode()
static ImmutableIntList
identity
(int count) Returns the identity list [0, ..., count - 1].incr
(int offset) Incrementsoffset
to each element of the list and returns a new int list.int
indexOf
(int seek) int
boolean
isEmpty()
iterator()
int
lastIndexOf
(int seek) int
lastIndexOf
(@Nullable Object o) listIterator
(int index) static ImmutableIntList
of()
Returns an empty ImmutableIntList.static ImmutableIntList
of
(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) boolean
boolean
removeAll
(Collection<?> c) boolean
retainAll
(Collection<?> c) int
size()
subList
(int fromIndex, int toIndex) Object[]
toArray()
<T> @Nullable T[]
toArray
(T @Nullable [] a) int[]
Returns an array ofint
s with the same contents as this list.Returns a List ofInteger
.toString()
Methods inherited from class org.apache.calcite.runtime.FlatLists.AbstractFlatList
toList
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
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 primitiveint
values. -
toArray
-
toArray
public <T> @Nullable T[] toArray(T @Nullable [] a) -
toIntArray
public int[] toIntArray()Returns an array ofint
s with the same contents as this list. -
toIntegerList
Returns a List ofInteger
. -
get
-
getInt
public int getInt(int index) -
iterator
-
listIterator
- Specified by:
listIterator
in interfaceList<Integer>
-
listIterator
- Specified by:
listIterator
in interfaceList<Integer>
-
indexOf
-
indexOf
public int indexOf(int seek) -
lastIndexOf
-
lastIndexOf
public int lastIndexOf(int seek) -
append
Description copied from class:FlatLists.AbstractFlatList
Returns a list that consists of a this list's elements plus a given element.- Specified by:
append
in 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
Incrementsoffset
to each element of the list and returns a new int list. -
add
- Specified by:
add
in interfaceCollection<E>
- Specified by:
add
in interfaceList<E>
-
addAll
- Specified by:
addAll
in interfaceCollection<E>
- Specified by:
addAll
in interfaceList<E>
-
addAll
-
removeAll
- Specified by:
removeAll
in interfaceCollection<E>
- Specified by:
removeAll
in interfaceList<E>
-
retainAll
- Specified by:
retainAll
in interfaceCollection<E>
- Specified by:
retainAll
in interfaceList<E>
-
clear
public void clear()- Specified by:
clear
in interfaceCollection<E>
- Specified by:
clear
in interfaceList<E>
-
set
-
add
-
remove
-
subList
-
contains
- Specified by:
contains
in interfaceCollection<E>
- Specified by:
contains
in interfaceList<E>
-
containsAll
- Specified by:
containsAll
in interfaceCollection<E>
- Specified by:
containsAll
in interfaceList<E>
-
remove
- Specified by:
remove
in interfaceCollection<E>
- Specified by:
remove
in interfaceList<E>
-