public interface ICollection<C,V> extends Iterable<V>
| Modifier and Type | Method and Description |
|---|---|
C |
clone() |
C |
forked()
This returns a data structure which is forked, which is equivalent to Clojure's persistent
data structures, also sometimes called functional or immutable.
|
boolean |
isLinear() |
C |
linear()
This returns a data structure which is linear, or temporarily mutable.
|
V |
nth(long idx) |
default V |
nth(long idx,
V defaultValue) |
C |
save(IDurableEncoding encoding,
Path directory) |
long |
size() |
IList<? extends C> |
split(int parts)
Splits the collection into roughly even pieces, for parallel processing.
|
forEach, iterator, spliteratorC linear()
If forked() is called on a linear collection, all references to that linear collection should be discarded.
If the data structure is already linear, it will simply return itself.
boolean isLinear()
C forked()
If only a single function or scope uses the data structure, it can be left as a linear data structure, which can have significant performance benefits.
If the data structure is already forked, it will simply return itself.
IList<? extends C> split(int parts)
parts subsets.parts - the target number of pieceslong size()
V nth(long idx)
idxIndexOutOfBoundsException - when idx is not within [0, size-1]default V nth(long idx, V defaultValue)
idx, or defaultValue if it is not within [0, size-1]C clone()
C save(IDurableEncoding encoding, Path directory)