Packages

t

de.h2b.scala.lib.coll.adt.searching

BasicSymbolTable

trait BasicSymbolTable[Key, Value] extends AnyRef

This trait represents a symbol table of generic key/value pairs.

It supports the usual put, get, contains, delete, size, and is-empty methods. It also provides a keys method for iterating over all of the keys.

A symbol table implements the associative array abstraction: when associating a value with a key that is already in the symbol table, the convention is to replace the old value with the new value.

Adapted from the book Algorithms 4 by R. Sedgewick and K. Wayne.

See also

Section 3.1 of Algorithms, 4th Edition

Algorithms, 4th edition by Robert Sedgewick and Kevin Wayne, Addison-Wesley Professional, 2011, ISBN 0-321-57351-X. http://algs4.cs.princeton.edu

Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. BasicSymbolTable
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Abstract Value Members

  1. abstract def apply(key: Key): Value

    returns

    value paired with key

    Exceptions thrown

    NoSuchElementException if key is not in table

  2. abstract def delete(key: Key): Unit

    Removes key/value pair from table.

    Removes key/value pair from table.

    Exceptions thrown

    NoSuchElementException if key is not in table

  3. abstract def keys(): Iterable[Key]

    returns

    all keys in the table

  4. abstract def size: Int
  5. abstract def update(key: Key, value: Value): Unit

    Inserts key/value pair into table.

    Inserts key/value pair into table. Replaces value if key is already there.

Concrete Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def clone(): AnyRef
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  6. def contains(key: Key): Boolean
  7. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  8. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  9. def finalize(): Unit
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  10. def get(key: Key): Option[Value]
  11. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
  12. def getOrElse(key: Key, default: ⇒ Value): Value
  13. def hashCode(): Int
    Definition Classes
    AnyRef → Any
  14. def isEmpty: Boolean
  15. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  16. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  17. final def notify(): Unit
    Definition Classes
    AnyRef
  18. final def notifyAll(): Unit
    Definition Classes
    AnyRef
  19. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  20. def toString(): String
    Definition Classes
    BasicSymbolTable → AnyRef → Any
  21. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  22. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  23. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped