sleep.runtime
Class MapWrapper

java.lang.Object
  extended by sleep.runtime.MapWrapper
All Implemented Interfaces:
java.io.Serializable, ScalarHash

public class MapWrapper
extends java.lang.Object
implements ScalarHash

A class for creating accessing a Map data structure in your application in a ready only way. It is assumed that your map data structure uses strings for keys. Accessed values will be marshalled into Sleep scalars

See Also:
Serialized Form

Field Summary
protected  java.util.Map values
           
 
Constructor Summary
MapWrapper(java.util.Map _values)
           
 
Method Summary
 Scalar getAt(Scalar key)
          Retrieves a scalar from the hashtable.
 ScalarArray keys()
          this operation is kind of expensive...
 void remove(Scalar key)
          Removes the specified scalar from the hashmap.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

values

protected java.util.Map values
Constructor Detail

MapWrapper

public MapWrapper(java.util.Map _values)
Method Detail

getAt

public Scalar getAt(Scalar key)
Description copied from interface: ScalarHash
Retrieves a scalar from the hashtable. If a scalar key does not exist then the key should be created with a value of $null. This $null or empty scalar value should be returned by the function. This is how values are added to Scalar hashes.

Specified by:
getAt in interface ScalarHash

keys

public ScalarArray keys()
this operation is kind of expensive... should be fixed up to take care of that

Specified by:
keys in interface ScalarHash

remove

public void remove(Scalar key)
Description copied from interface: ScalarHash
Removes the specified scalar from the hashmap. :)

Specified by:
remove in interface ScalarHash

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object