Bucket

scalation.database.LinHashMap.Bucket
class Bucket() extends Serializable

The Bucket inner class defines buckets that are stored in this hash table.

Attributes

Graph
Supertypes
trait Serializable
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

def add(k: K, v: V): Boolean

Add the given key-value pair to this bucket, returning true if successful and false otherwise (when this bucket is full).

Add the given key-value pair to this bucket, returning true if successful and false otherwise (when this bucket is full).

Value parameters

k

the key

v

the value

Attributes

def find(k: K): V

Find key k in this bucket, returning the corresponding value or null if not found.

Find key k in this bucket, returning the corresponding value or null if not found.

Value parameters

k

the key to find in this bucket

Attributes

inline def findPos(k: K): Int

Find the position of key k in this bucket, returning its position in the bucket, or -1 if not found.

Find the position of key k in this bucket, returning its position in the bucket, or -1 if not found.

Value parameters

k

the key to find in this bucket

Attributes

def move(j: Int, b2: Bucket): Boolean

Move the j-th element (key-value pair) to bucket b2, returning true if successful and false otherwise (when bucket b2 is full). Simply remove the j-th element when b2 is null.

Move the j-th element (key-value pair) to bucket b2, returning true if successful and false otherwise (when bucket b2 is full). Simply remove the j-th element when b2 is null.

Value parameters

b2

the other bucket to move the pair to

j

the j-th key-value pair

Attributes

def show(): Unit

Show/print the contents of this bucket.

Show/print the contents of this bucket.

Attributes

Concrete fields

val key: Array[K]
var nKeys: Int
var next: Bucket
val value: Array[V]