"WEBNMS_5 API Docs"

com.adventnet.nms.store
Class SerializeHashtable

java.lang.Object
  extended by com.adventnet.nms.store.SerializeHashtable
Direct Known Subclasses:
SerializePropertytable, SerializeVectortable

public class SerializeHashtable
extends java.lang.Object

Used when WebNMS is run in serialized mode. Maintains a hashtable of 1000 elements in memory and the rest in serialized files.


Constructor Summary
protected SerializeHashtable()
           
  SerializeHashtable(java.lang.String name)
           
 
Method Summary
 void clear()
          Clears this hashtable.
 java.lang.Object clone()
           
 boolean contains(java.lang.Object value)
           
 boolean containsKey(java.lang.Object key)
           
 boolean containsValue(java.lang.Object value)
           
 java.util.Enumeration elements()
           
 java.lang.Object get(java.lang.Object key)
          Returns an Object mapped to the given key.
static int getMaxValue()
           
 boolean isEmpty()
           
 java.util.Enumeration keys()
           
 void makeBuffer()
           
 java.lang.Object put(java.lang.Object key, java.lang.Object value)
          Adds a key value pair to the hashtable.
 java.lang.Object remove(java.lang.Object key)
          Removes a key value pair given the key.
 void restore()
           
 void saveState()
           
static void setMaxValue(int i)
          Sets the number of elements to be kept in memory.
 int size()
          Returns the total size of this vector.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SerializeHashtable

protected SerializeHashtable()

SerializeHashtable

public SerializeHashtable(java.lang.String name)
Parameters:
String - The name of the state files as well as the name of the directory in which the serialized files are to be stored.
Method Detail

setMaxValue

public static void setMaxValue(int i)
Sets the number of elements to be kept in memory.

Parameters:
int - The maximum number of elements to be stored in memory

getMaxValue

public static int getMaxValue()

get

public java.lang.Object get(java.lang.Object key)
Returns an Object mapped to the given key.

Parameters:
obj - The key as a object.

put

public java.lang.Object put(java.lang.Object key,
                            java.lang.Object value)
Adds a key value pair to the hashtable.


size

public int size()
Returns the total size of this vector.


isEmpty

public boolean isEmpty()

clear

public void clear()
Clears this hashtable.


remove

public java.lang.Object remove(java.lang.Object key)
Removes a key value pair given the key.

Parameters:
key - The key of the pair to be removed.
Returns:
The object mapped to the key. Returns null if the key is not found.

containsKey

public boolean containsKey(java.lang.Object key)

contains

public boolean contains(java.lang.Object value)

containsValue

public boolean containsValue(java.lang.Object value)

elements

public java.util.Enumeration elements()

keys

public java.util.Enumeration keys()

clone

public java.lang.Object clone()
Overrides:
clone in class java.lang.Object

saveState

public void saveState()

restore

public void restore()

makeBuffer

public void makeBuffer()

"WEBNMS_5 API Docs"

Copyright © 2011 ZOHO Corp., All Rights Reserved.