scoop:scoop.std:0.1.0
scoop.collections
API
-
class
ArrayDeque
A growable double-ended queue with constant-time indexed ring-buffer access at either end. Structural changes invalidate active iterators.
-
class
ConcurrentModificationException
A collection changed structurally during iteration, or was modified from a lookup/comparison callback.
-
class
HashMap
A mutable hash table using key equality and hash codes. Keys must retain consistent equality and hashes while stored; iteration order is unspecified.
-
class
HashSet
A mutable hash set with unspecified iteration order. Stored elements must retain consistent equality and hashes.
-
struct
IndexedValue
An element paired with its zero-based Long iteration index.
-
class
LinkedHashMap
A mutable hash map whose iteration follows insertion order. Replacing an existing value retains its position; removing and reinserting moves it to the end.
-
class
LinkedHashSet
A mutable hash set that iterates in insertion order. Adding an existing member retains its position.
-
interface
Map
Read access to key-value associations. Missing keys return None; iteration and views expose entries in the implementation's order.
-
interface
MutableMap
A map supporting insertion, replacement, removal, and clearing.
-
interface
MutableSet
A set supporting membership changes; add/remove report whether membership changed.
-
interface
MutableSortedMap
An ordered map supporting mutation while preserving its comparator-based key order.
-
interface
MutableSortedSet
An ordered set supporting membership changes.
-
class
NoSuchElementException
An element was required from an empty collection or an unsuccessful lookup.
-
class
PriorityQueue
A binary min-heap ordered by its comparator. Removal returns the smallest element; iteration exposes heap order, not sorted order. Structural changes invalidate iterators.
-
interface
Set
A collection containing at most one representative of each element according to its membership rule.
-
interface
SortedMap
A map ordered by its comparator, with nearest-key queries returning None when no bound exists.
-
interface
SortedSet
A set ordered by its comparator, with nearest-element queries returning None when no bound exists.
-
class
TreeMap
A mutable ordered map using the supplied comparator for both order and key equivalence. Iteration visits ascending keys; comparator-equivalent keys occupy one entry.
-
class
TreeSet
A mutable set ordered by its comparator. Comparator-equivalent elements share one membership slot.
-
function
addAll
Adds each supplied element to the destination. Set overloads report whether membership changed.
-
function
all
Returns whether every element satisfies the predicate; true for empty input.
-
function
any
Returns whether any eligible element exists, applying the predicate when supplied and stopping at the first match.
-
function
arrayListOf
Returns a new mutable array list in argument order.
-
function
associate
Builds a map from transformed key-value pairs; later values replace earlier values for equal keys.
-
function
associateBy
Builds a map using selected keys and optional value transformation; the last value for each key wins.
-
function
associateWith
Associates each element with its selected value; later equal elements replace the stored value.
-
function
binarySearch
Searches a range sorted by the same ordering. The range is fromIndex inclusive to toIndex exclusive; absence returns -(insertionIndex + 1).
-
function
chunked
Partitions input into copied, nonoverlapping chunks of positive size; the final chunk may be shorter.
-
function
contains
Stops at the first equal element and reports whether one exists.
-
function
containsValue
Scans values for one equal to the argument.
-
function
copyOfRange
Copies the comparator-bounded range into an independent read-only ordered collection. Bounds default to lower-inclusive and upper-exclusive; reversed bounds throw.
-
function
count
Counts eligible elements, applying the predicate when supplied.
-
function
distinct
Retains the first occurrence of each equal element in a new list.
-
function
distinctBy
Retains the first element for each selected key in a new list, preserving encounter order.
-
function
drop
Skips the first nonnegative count and copies the remainder into a list.
-
function
dropWhile
Skips the initial run satisfying the predicate and copies the remainder.
-
function
elementAt
Returns the element at a zero-based iteration index; an out-of-range index throws IndexOutOfBoundsException.
-
function
elementAtOrNone
Returns the element at a zero-based iteration index, or None for a negative or out-of-range index.
-
function
emptyList
Returns an empty read-only list.
-
function
emptyMap
Returns an empty read-only map.
-
function
emptySet
Returns an empty read-only set.
-
function
filter
Copies elements satisfying the predicate into a new list in iteration order.
-
function
filterNot
Copies elements failing the predicate into a new list in iteration order.
-
function
filterNotNone
Copies and unwraps Some elements into a new list, skipping None.
-
function
filterTo
Appends matching elements to the destination and returns it.
-
function
find
Returns the first element satisfying the predicate, or None.
-
function
first
Returns the first eligible element in iteration order, applying the predicate when supplied; absence throws NoSuchElementException.
-
function
firstOrNone
Returns the first eligible element in iteration order, applying the predicate when supplied, or None.
-
function
flatMap
Concatenates each transformed iterable into a new list in source order.
-
function
flatMapTo
Appends each transformed iterable to the destination and returns it.
-
function
flatten
Concatenates the nested iterables into a new list in outer and inner iteration order.
-
function
fold
Accumulates left to right from the supplied initial value, which is returned for empty input.
-
function
forEach
Runs the action for each element in iteration order.
-
function
forEachIndexed
Runs the action with each element and its zero-based Long index.
-
function
getOrDefault
Returns the mapped value, or the supplied fallback when absent.
-
function
getOrElse
Returns the mapped value, computing the fallback only when the key is absent.
-
function
getOrPut
Returns an existing value, or computes, inserts, and returns one for an absent key. This operation is not a concurrent-map primitive.
-
function
getValue
Returns the mapped value or throws NoSuchElementException when the key is absent.
-
function
groupBy
Groups values into lists by the selected key, retaining encounter order within each group.
-
function
groupByTo
Appends values into the destination's per-key mutable lists and returns that destination.
-
function
hashMapOf
Creates a hash map from pairs; the last value for an equal key wins.
-
function
hashSetOf
Creates a hash set from the distinct supplied elements.
-
function
indexOf
Returns the first equal element's zero-based iteration index, or -1 if absent.
-
function
intersect
Returns a set containing members present in both inputs.
-
function
isEmpty
Returns whether the collection contains no entries or elements.
-
function
isNotEmpty
Returns whether the collection contains at least one entry or element.
-
function
joinToString
Joins rendered elements with separator, prefix, and postfix. A nonnegative limit bounds rendered elements and appends truncated text when more remain.
-
function
last
Returns the last eligible element after traversal, applying the predicate when supplied; absence throws NoSuchElementException.
-
function
lastOrNone
Returns the last eligible element after traversal, applying the predicate when supplied, or None.
-
function
linkedMapOf
Creates an insertion-ordered map; replacing an equal key retains its first position.
-
function
linkedSetOf
Creates a mutable set in first-insertion order.
-
function
listDecoder
Creates a list decoder using the supplied element codec.
-
function
listEncoder
Creates a list encoder using the supplied element codec.
-
function
listOf
Returns a read-only list in argument order.
-
function
map
Transforms each element into a new list in iteration order.
-
function
mapIndexed
Transforms each element with its zero-based Long index into a new list.
-
function
mapNotNone
Transforms each element, retaining and unwrapping only Some results in a new list.
-
function
mapOf
Creates a read-only insertion-ordered map from pairs; the last value for each key wins.
-
function
mapTo
Appends transformed elements to the destination and returns it.
-
function
maxOrNone
Traverses the input for its greatest element in natural order, returning None when empty.
-
function
maxWithOrNone
Traverses the input for its greatest element under the comparator, returning None when empty.
-
function
minOrNone
Traverses the input for its least element in natural order, returning None when empty.
-
function
minWithOrNone
Traverses the input for its least element under the comparator, returning None when empty.
-
function
mutableListOf
Returns a new mutable list in argument order.
-
function
mutableMapOf
Creates a mutable insertion-ordered map from pairs; the last value for each key wins.
-
function
mutableSetOf
Creates a mutable set in first-insertion order.
-
function
none
Returns whether no eligible element exists, applying the predicate when supplied and stopping at the first match.
-
function
onEach
Runs the action eagerly for all elements and returns the original iterable.
-
function
partition
Returns two lists: matching elements first and nonmatching elements second, each retaining source order.
-
function
priorityQueueOf
Creates a min-priority queue from the supplied elements using the selected ordering.
-
function
putAll
Copies associations into this map; later occurrences replace the value for the same key.
-
function
random
Selects one element using the supplied random source; empty input throws NoSuchElementException.
-
function
randomOrNone
Selects one element using the supplied random source, or returns None for empty input.
-
function
reduce
Accumulates left to right from the first element; empty input throws NoSuchElementException.
-
function
reduceOrNone
Accumulates left to right from the first element, or returns None for empty input.
-
function
removeAll
Removes members equal to the supplied elements and reports whether this collection changed.
-
function
retainAll
Removes elements not present in the supplied membership collection and reports whether this list changed.
-
function
reversed
Returns an independent list in reverse iteration order.
-
function
setOf
Creates a read-only set in first-encounter order.
-
function
shuffle
Permutes this mutable list in place using the supplied random source.
-
function
shuffled
Copies the elements into a randomly permuted list using the supplied random source.
-
function
single
Requires exactly one eligible element. No match throws NoSuchElementException; multiple matches throw IllegalArgumentException.
-
function
singleOrNone
Returns the sole eligible element, or None for zero or multiple matches.
-
function
sort
Stably sorts this mutable list in place in natural ascending order.
-
function
sortWith
Stably sorts this mutable list in place using the supplied comparator.
-
function
sorted
Returns a stable copy in natural ascending order.
-
function
sortedBy
Returns a stable copy ordered by the selector's natural key order.
-
function
sortedDescending
Returns a stable copy in natural descending order.
-
function
sortedMapOf
Creates an ordered map using the supplied or natural comparator; comparator-equivalent keys share one entry.
-
function
sortedSetOf
Creates an ordered set using the supplied or natural comparator.
-
function
sortedWith
Returns a stable sorted copy using the supplied comparator.
-
function
subtract
Returns a set containing members of this input absent from the other input.
-
function
take
Copies at most the first nonnegative count of elements into a list.
-
function
takeWhile
Copies the longest initial run satisfying the predicate.
-
function
toCollection
Adds all source elements to the destination and returns it.
-
function
toList
Copies elements in encounter order into a read-only list.
-
function
toMap
Copies associations into a read-only map; later values for equal keys win.
-
function
toMutableList
Copies elements in encounter order into a new mutable list.
-
function
toMutableMap
Copies associations into a new mutable map; later values for equal keys win.
-
function
toMutableSet
Copies distinct elements into a new mutable insertion-ordered set.
-
function
toSet
Copies distinct elements into a read-only set in first-encounter order.
-
function
toSortedMap
Copies associations into a read-only ordered map using the selected ordering.
-
function
toSortedSet
Copies elements into a read-only ordered set using the selected ordering.
-
function
union
Returns a set containing members from either input.
-
function
windowed
Produces copied windows at the requested step. Size and step must be positive; incomplete trailing windows are included only when partialWindows is true.
-
function
withIndex
Pairs each element with its zero-based Long index as it is iterated.
-
function
zip
Pairs elements by position, stopping when either input ends.
Re-exports
- re-export List
- re-export Iterable
- re-export MutableList
- re-export Iterator
- re-export Collection
- re-export ArrayList