The Map interface implements an associative set, where a name can be mapped to a value. Maps wrap the ASP collection which store Variants, but provide only the methods for getting/setting a value in the collection. Objects that implement Map, and which actually encapsulate the objects (i.e., ObjectDictionary, RequestDictionary) will also typically extend java.util.Dictionary, and the implement the Enumerator interface
The ASP Maps have been extended to allow auto-conversion between the variant representation and common Java types that have directly analogous variant types. So, for example, such as Object, String, Date, would map to IUnknown, BSTR, and OLE Date objects while intrinsic Java types such as int, boolean, float, etc., would be converted to appropriate Variant object types. So, for example, the programmer could use the Session collection, store and retrieve an integer or java.util.Date object, and conversions between the Java and Variant types would be done transparently. The goal is to allow the Java developer to interact with data types that are comfortable and natural, while exposing them to the script developer that is natural for that environment.
Note that there are some Maps, such as the various Request collections, that are read-only. For these, calls to a put method should throw an AspComponentException exception.
public interface Map {
int getType(String name); // Returns the Variant type of the object
Object getObject(String name) throws ClassCastException;
boolean getBoolean(String name) throws ClassCastException;
byte getByte(String name) throws ClassCastException;
short getShort(String name) throws ClassCastException;
char getChar(String name) throws ClassCastException;
int getInt(String name) throws ClassCastException;
long getLong(String name) throws ClassCastException;
float getFloat(String name) throws ClassCastException;
double getDouble(String name) throws ClassCastException;
String getString(String name) throws ClassCastException;
Date getDate(String name) throws ClassCastException;
Variant getVariant(String name) throws ClassCastException;
Void setObject(String name, Object o) throws AspComponentException;
Void setBoolean(String name,boolean b) throws AspComponentException;
Void setByte(String name,byte b) throws AspComponentException;
Void setShort(String name,short s) throws AspComponentException;
Void setInt(String name,int i) throws AspComponentException;
Void setFloat(String name,float f) throws AspComponentException;
Void setDouble(String name,double d) throws AspComponentException;
Void setString(String name,String str) throws AspComponentException;
Void setDate(String name, Date d) throws AspComponentException;
Void setVariant(String name, Variant var) throws AspComponentException;
}