Package org.javimmutable.collections
Class IArrays
java.lang.Object
org.javimmutable.collections.IArrays
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> IArray
<T> Creates a sparse array containing all of the values from source that supports any integer (positive or negative) as an index.static <T> IArray
<T> Creates a sparse array containing all of the values from source that supports any integer (positive or negative) as an index.static <T> IArray
<T> Creates a sparse array containing all of the values from source that supports any integer (positive or negative) as an index.static <T> IArray
<T> Creates a sparse array containing all of the values in the specified range from source that supports any integer (positive or negative) as an index.static <T> IArrayBuilder
<T> builder()
Produces a Builder for efficiently constructing a IArray built atop a 32-way integer trie.static <T> IArray
<T> of()
Creates an empty sparse array that supports any integer (positive or negative) as an index.static <T> IArray
<T> of
(T... source) Creates an empty sparse array that supports any integer (positive or negative) as an index.
-
Method Details
-
of
Creates an empty sparse array that supports any integer (positive or negative) as an index. Indexes do not need to be consecutive there can be gaps of any size between indexes. -
of
Creates an empty sparse array that supports any integer (positive or negative) as an index. Indexes do not need to be consecutive there can be gaps of any size between indexes. Copies all values into the array starting at index zero. -
allOf
Creates a sparse array containing all of the values from source that supports any integer (positive or negative) as an index. Indexes do not need to be consecutive there can be gaps of any size between indexes. Copies all entries into the array using each key as an index for storing the corresponding value. -
allOf
Creates a sparse array containing all of the values from source that supports any integer (positive or negative) as an index. Indexes do not need to be consecutive there can be gaps of any size between indexes. Copies all entries into the array using each key as an index for storing the corresponding value. -
allOf
@Nonnull public static <T> IArray<T> allOf(@Nonnull Indexed<? extends T> source, int offset, int limit) Creates a sparse array containing all of the values in the specified range from source that supports any integer (positive or negative) as an index. Indexes do not need to be consecutive there can be gaps of any size between indexes. Copies all entries into the array using each key as an index for storing the corresponding value. The values copied from source are those whose index are in the range offset to (limit - 1). -
allOf
Creates a sparse array containing all of the values from source that supports any integer (positive or negative) as an index. Indexes do not need to be consecutive there can be gaps of any size between indexes. Copies all entries into the array using each key as an index for storing the corresponding value. -
builder
Produces a Builder for efficiently constructing a IArray built atop a 32-way integer trie. All values added by the builder are assigned consecutive indices starting with zero.
-