HashTable

Kind of class:class
Inherits from:none
Classpath:org.springsoft.aslib.HashTable
File last modified:Saturday, 22 January 2005, 14:27:02

Summary


Constructor
Instance properties
Instance methods
  • put (key:Number, data:HashTableObject) : Void
    • Put item in HashTable
  • get (key:Number) : HashTableObject
    • Get an item from the HashTable
  • remove (key:Number) : Void
    • Remove an item from the HashTable
  • removeAll (Void) : Void
    • Remove all items from the HashTable
  • size (Void) : Number
    • Get the size of the HashTable
  • isEmpty (Void) : Boolean
    • Check if the HashTable is empty
  • print (Void) : Void
    • Print HashTable

Constructor

HashTable

function HashTable (
size:Number)

HashTable Constructor
Parameters:
size:
The HashTable array size

Instance properties

hashTable_

private hashTable_:Array
(read)

numItems_

private numItems_:Number = 0
(read)

size_

private size_:Number = 50
(read)

Instance methods

get

function get (
key:Number) : HashTableObject

Get an item from the HashTable
Parameters:
key:
The hash key
Returns:
  • data object

isEmpty

function isEmpty (
Void) : Boolean

Check if the HashTable is empty
Returns:
  • true if HashTable is empty. Otherwise returns false.

print

function print (
Void) : Void

Print HashTable

put

function put (
key:Number, data:HashTableObject) : Void

Put item in HashTable
Parameters:
key :
Hash key
data:
Data object

remove

function remove (
key:Number) : Void

Remove an item from the HashTable
Parameters:
key:
The hash key

removeAll

function removeAll (
Void) : Void

Remove all items from the HashTable

size

function size (
Void) : Number

Get the size of the HashTable
Returns:
  • size of HashTable