Hash
Library
hash.js
Description
A class which implements something more robust than the JavaScript Array when used as a hash, including a length property, and various methods for sorting, stepping through, and removing items.
Property Summary
cursorPos -- The position of the internal cursor for the Hash.
length -- The number of items in the Hash.
Method Summary
allKeys -- Returns a comma-separated list of all the keys in the Hash.
end -- Sets the position of the internal cursor to the last position.
getAtPos -- Returns the value of the item in the Hash for that cursor position.
getCurrent -- Returns the value of the item in the Hash at the current position of the internal cursor.
getFirst -- Returns the value of the item in the first position of the Hash.
getItem -- Returns the value of the item for a specific key in the Hash.
getLast -- Returns the value of the item in the last position of the Hash.
getNext -- Increments the internal cursor for the Hash, and then returns the value of the item in that cursor position.
getPrevious -- Decrements the internal cursor for the Hash, and then returns the value of the item in that cursor position.
hasKey -- Returns Boolean true if the key exists in the Hash, false if it does not.
hasValue -- Returns Boolean true if the value exists in the Hash, false if it does not.
pop -- Returns the value of the item in the last position of the Hash, and removes that element.
removeAtPos -- Removes an item in the Hash a specific position.
removeItem -- Removes an item in the Hash for a specific key.
replaceKey -- Replaces a key in the Hash with a new one.
reset -- Sets the position of the internal cursor to the first position.
setItem -- Sets the value of the item in the Hash with that key to the desired value. Adds a new item if the key does not exist.