Class ImmutableIntArray.Builder
java.lang.Object
com.google.common.primitives.ImmutableIntArray.Builder
- Enclosing class:
ImmutableIntArray
A builder for
ImmutableIntArray
instances; obtained using ImmutableIntArray.builder(int)
.- Since:
- 22.0
-
Method Summary
Modifier and TypeMethodDescriptionadd
(int value) Appendsvalue
to the end of the values the builtImmutableIntArray
will contain.addAll
(int[] values) Appendsvalues
, in order, to the end of the values the builtImmutableIntArray
will contain.addAll
(ImmutableIntArray values) Appendsvalues
, in order, to the end of the values the builtImmutableIntArray
will contain.Appendsvalues
, in order, to the end of the values the builtImmutableIntArray
will contain.addAll
(Collection<Integer> values) Appendsvalues
, in order, to the end of the values the builtImmutableIntArray
will contain.Appends all values fromstream
, in order, to the end of the values the builtImmutableIntArray
will contain.build()
Returns a new immutable array.
-
Method Details
-
add
Appendsvalue
to the end of the values the builtImmutableIntArray
will contain. -
addAll
Appendsvalues
, in order, to the end of the values the builtImmutableIntArray
will contain. -
addAll
Appendsvalues
, in order, to the end of the values the builtImmutableIntArray
will contain. -
addAll
Appendsvalues
, in order, to the end of the values the builtImmutableIntArray
will contain. -
addAll
Appends all values fromstream
, in order, to the end of the values the builtImmutableIntArray
will contain.- Since:
- 22.0 (but only since 33.4.0 in the Android flavor)
-
addAll
Appendsvalues
, in order, to the end of the values the builtImmutableIntArray
will contain. -
build
Returns a new immutable array. The builder can continue to be used after this call, to append more values and build again.Performance note: the returned array is backed by the same array as the builder, so no data is copied as part of this step, but this may occupy more memory than strictly necessary. To copy the data to a right-sized backing array, use
.build().trimmed()
.
-