Package avail.utility.structures

Types

Link copied to clipboard
class BloomFilter

A BloomFilter is a conservative, probabilistic set. It can report that an element is probably in the set, or definitely not in the set. This can be a useful, fast prefilter to avoid computing or fetching authoritative data in a large majority of cases, effectively reducing the number of spurious occurrences of the slower activity by orders of magnitude.

Link copied to clipboard
class EnumMap<K : Enum<K>, V : Any>(enums: Array<K>, sourceValues: Array<V?>) : MutableMap<K, V>

An EnumMap is a Map implementation for use with enum type keys only. All of the keys in an EnumMap must come from a single enum that is specified, explicitly as the first parameterized type. EnumMaps are represented internally as arrays. Enum maps are maintained in the natural order of their keys (Enum.ordinals).

Link copied to clipboard
sealed class LeftistHeap<Value : Comparable<Value>>

A LeftistHeap is a persistent (immutable) priority queue. The first operation is O(1), and with and withoutFirst are O(log(n)). The latter two also produce a new LeftistHeap without modifying the original.

Link copied to clipboard
class LeftistInternal<Value : Comparable<Value>>(    val first: Value,     val left: LeftistHeap<Value>,     val right: LeftistHeap<Value>) : LeftistHeap<Value>
Link copied to clipboard
class RunTree<Value> : Iterable<Triple<Long, Long, Value>>

A RunTree maintains a mapping from Long to some value which is expected to be the same for runs of consecutive Longs. This is not thread-safe, and should be protected with an external ReadWriteLock to allow readers and writers to coordinate safely.

Functions

Link copied to clipboard
fun <Value : Comparable<Value>> leftistLeaf(): LeftistHeap<Value>