semitwist.util.array

Undocumented in source.

Members

Classes

MissingKeyException
class MissingKeyException
Undocumented in source.

Functions

allExcept
T allExcept(T from, T except)

Returns everything in 'from' minus the values in 'except'.

allExcept
T[] allExcept(T[] from, T except)
Undocumented in source. Be warned that the author may not have intended to support it.
findPrior
size_t findPrior(T[] collection, bool delegate(T[], size_t) isFound, size_t start)
Undocumented in source. Be warned that the author may not have intended to support it.
getRequired
TVal getRequired(TVal[TKey] aa, TKey key)
Undocumented in source. Be warned that the author may not have intended to support it.
indexOfMax
size_t indexOfMax(T[] array)
Undocumented in source. Be warned that the author may not have intended to support it.
indexOfMin
size_t indexOfMin(T[] array)
Undocumented in source. Be warned that the author may not have intended to support it.
maxLength
size_t maxLength(T[][] arrays)
Undocumented in source. Be warned that the author may not have intended to support it.
randomBytes
ubyte[] randomBytes(size_t numBytes)
Undocumented in source. Be warned that the author may not have intended to support it.
removeLeft
T[] removeLeft(T[] haystack, T[] needle)

If 'haystack' begins with 'needle', remove 'needle'

removeRight
T[] removeRight(T[] haystack, T[] needle)

If 'haystack' ends with 'needle', remove 'needle'

toRangedPairs
T[2][] toRangedPairs(T[] arr)

Ex: toRangedPairs([3,4,5,5,6,6,10,25,26]) == [[3,6], [10,10], [25,26]] Only intended for integer types and other ordered types for which "x+1" makes sense. Input does not have to be sorted. The resulting pairs are sorted and are inclusive on both ends. Optionally takes a splitCond predicate so you can customize when the range ends.

Meta