CharHashSet

open class CharHashSet @JvmOverloads constructor(expectedElements: Int, loadFactor: Double = DEFAULT_LOAD_FACTOR.toDouble()) : Iterable<CharCursor> , Accountable, Cloneable<CharHashSet>

A hash set of chars, implemented using open addressing with linear probing for collision resolution.

Mostly forked and trimmed from com.carrotsearch.hppc.CharHashSet

github: https://github.com/carrotsearch/hppc release 0.10.0

Constructors

Link copied to clipboard
constructor(expectedElements: Int, loadFactor: Double = DEFAULT_LOAD_FACTOR.toDouble())
constructor()

New instance with sane defaults.

constructor(set: CharHashSet)

New instance copying elements from another set.

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

Returns nested resources of this class. The result should be a point-in-time snapshot (to avoid race conditions).

Link copied to clipboard
Link copied to clipboard

The hash array holding keys.

Functions

Link copied to clipboard
fun add(key: Char): Boolean
Link copied to clipboard
fun addAll(iterable: Iterable<CharCursor>): Int
fun addAll(vararg elements: Char): Int
Link copied to clipboard
fun clear()
Link copied to clipboard
open override fun clone(): CharHashSet
Link copied to clipboard
fun contains(key: Char): Boolean
Link copied to clipboard
fun ensureCapacity(expectedElements: Int)
Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
fun indexExists(index: Int): Boolean
Link copied to clipboard
fun indexGet(index: Int): Char
Link copied to clipboard
fun indexInsert(index: Int, key: Char)
Link copied to clipboard
fun indexOf(key: Char): Int
Link copied to clipboard
fun indexRemove(index: Int)
Link copied to clipboard
fun indexReplace(index: Int, equivalentKey: Char): Char
Link copied to clipboard
open operator override fun iterator(): Iterator<CharCursor>
Link copied to clipboard
open override fun ramBytesUsed(): Long

Return the memory usage of this object in bytes. Negative values are illegal.

Link copied to clipboard
fun release()
Link copied to clipboard
fun remove(key: Char): Boolean
Link copied to clipboard
Link copied to clipboard
fun size(): Int
Link copied to clipboard