Class IndexedHelper
java.lang.Object
org.javimmutable.collections.indexed.IndexedHelper
Provides a number of static utility methods for producing Indexed objects
from raw values. Useful when you need an Indexed but don't have or want
to create an array just to get an Indexed of them.
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> List
<T> Creates a mutable List containing all values from the Indexed.static <T> Indexed
<T> empty()
static <T,
V extends T>
Indexed<T> indexed
(V a) Returns an Indexed containing a single value.static <T,
V extends T>
Indexed<T> indexed
(V a, V b) Returns an Indexed containing two values.static <T,
V extends T>
Indexed<T> indexed
(V a, V b, V c) Returns an Indexed containing three values.static <T,
V extends T>
Indexed<T> indexed
(V a, V b, V c, V... others) Returns an Indexed containing three values.range
(int low, int high) static <T> Indexed
<T> repeating
(T value, int count)
-
Method Details
-
empty
-
indexed
Returns an Indexed containing a single value. Note that the type of the Indexed may be a subclass of the type of the value. -
indexed
Returns an Indexed containing two values. Note that the type of the Indexed may be a subclass of the type of the value. -
indexed
Returns an Indexed containing three values. Note that the type of the Indexed may be a subclass of the type of the value. -
indexed
Returns an Indexed containing three values. Note that the type of the Indexed may be a subclass of the type of the value. -
repeating
-
range
-
asList
Creates a mutable List containing all values from the Indexed.
-