|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.util.Dictionary | +--java.util.Hashtable | +--Interpreter.Sexp.Utils.SexpHashtable
La classe SexpHashtable realizza un Environment per S-expressions. La chiave è una stringa, il valore è una Sexp .
Rispetto alla classe Hashtable sono stati ridefiniti alcuni metodi.
Quelli non ridefiniti sono:
public int size(): returns the number of elements contained in the hashtable.
public boolean isEmpty(): returns true if the hashtable contains no elements.
public synchronized Enumeration keys(): returns an enumeration of the hashtable's keys.
public synchronized Enumeration elements(): returns an enumeration of the elements. Use the Enumeration methods on the returned object to fetch the elements sequentially.
public synchronized void clear(): clears the hash table so that it has no more elements in it.
public synchronized Object clone(): creates a clone of the hashtable. A shallow copy is made, the keys and elements themselves are NOT cloned. This is a relatively expensive operation.
public synchronized String toString(): converts to a rather lengthy String.
Constructor Summary | |
SexpHashtable()
Costruisce un nuovo SexpHashtable vuoto. |
|
SexpHashtable(int c)
Costruisce un nuovo SexpHashtable vuoto. |
|
SexpHashtable(int c,
float lf)
Costruisce un nuovo SexpHashtable vuoto. |
Method Summary | |
SexpHashtable |
Clone()
Crea una deep copy dell'oggetto. |
boolean |
contains(Sexp value)
Returns true if the specified Sexp object is an element of the hashtable. |
boolean |
containsKey(java.lang.String key)
Returns true if the collection contains an element for the key. |
Sexp |
get(Sexp key)
Gets the Sexp object associated with the specified key in the hashtable. |
Sexp |
get(java.lang.String key)
Gets the Sexp object associated with the specified key in the hashtable. |
Sexp |
put(java.lang.String key,
Sexp value)
Puts the specified element into the hashtable, using the specified key. |
Sexp |
remove(java.lang.String key)
Removes the element corresponding to the key. |
Methods inherited from class java.util.Hashtable |
clear,
clone,
contains,
containsKey,
containsValue,
elements,
entrySet,
equals,
get,
hashCode,
isEmpty,
keys,
keySet,
put,
putAll,
rehash,
remove,
size,
toString,
values |
Methods inherited from class java.lang.Object |
finalize,
getClass,
notify,
notifyAll,
wait,
wait,
wait |
Constructor Detail |
public SexpHashtable()
public SexpHashtable(int c)
c
- capacità iniziale, ovvero numero di entries iniziali.public SexpHashtable(int c, float lf)
c
- capacità iniziale, ovvero numero di entries iniziali.lf
- float compreso fra 0.0 e 1.0,
rappresentante il fattore di caricamento.Method Detail |
public boolean contains(Sexp value)
value
- the value that we are looking forHashtable.containsKey(java.lang.Object)
public boolean containsKey(java.lang.String key)
key
- the key that we are looking forHashtable.contains(java.lang.Object)
public Sexp get(java.lang.String key)
key
- the specified keyHashtable.put(java.lang.Object, java.lang.Object)
public Sexp get(Sexp key)
key
- the specified keyHashtable.put(java.lang.Object, java.lang.Object)
public Sexp put(java.lang.String key, Sexp value)
key
- the specified key in the hashtablevalue
- the specified elementHashtable.get(java.lang.Object)
public Sexp remove(java.lang.String key)
key
- the key that needs to be removedpublic SexpHashtable Clone()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |