public class HashChain
extends java.lang.Object
implements java.util.Comparator<int[]>
Constructor and Description |
---|
HashChain(java.lang.String name) |
HashChain(java.lang.String name,
int capacity) |
HashChain(java.lang.String name,
int capacity,
int numOfReplica) |
Modifier and Type | Method and Description |
---|---|
int |
add(java.lang.String key) |
int |
add(java.lang.String key,
int weight)
It adds the key to the KeyChain and returns its id
|
Browser |
browser()
returns a browser for all keys
|
void |
clear() |
int |
compare(int[] a,
int[] b)
It compares a and b in the ascending order
|
void |
dump() |
int |
getCapacity() |
int |
getID(java.lang.String key) |
java.lang.String |
getKey(int id) |
int |
getMeasure(java.lang.String key)
returns the measure in the HashChain for the given node
|
int |
getSize() |
static void |
main(java.lang.String[] args) |
int |
map(java.lang.String msg)
It maps the msg to a key and returns its id upon success or -1 otherwise
|
int |
remove(java.lang.String key)
It removes the key from the HashChain and returns its id
|
public HashChain(java.lang.String name, int capacity, int numOfReplica)
public HashChain(java.lang.String name, int capacity)
public HashChain(java.lang.String name)
public int add(java.lang.String key, int weight)
public int add(java.lang.String key)
public int remove(java.lang.String key)
public int map(java.lang.String msg)
public int getMeasure(java.lang.String key)
public java.lang.String getKey(int id)
public int getID(java.lang.String key)
public Browser browser()
public int getCapacity()
public int getSize()
public void clear()
public int compare(int[] a, int[] b)
compare
in interface java.util.Comparator<int[]>
public void dump()
public static void main(java.lang.String[] args)