|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--org.PingOO.DLAI.lib.util.MessageHashtable
A derived hashtable to use in the protocol to send message to the server.
This hashtable delegates to basic Hashtable, so it can be used with only String keys and can only contain String, String[], BinaryData or ValueHashtable values.
This class is designed primary for network exchange not for data handling. You may use a real hashtable for this kind of operations.
Hashtable| Field Summary | |
static java.lang.String |
ACCEPTED_KEY
Indicates an accepted line. |
static java.lang.String |
COMMENT_KEY
Indicates an comment line. |
static java.lang.String |
FUNCTION_KEY
This key is needed to get the name of the function which uses this Hashtable. |
private java.util.Hashtable |
hashtable
A private inner Hashtable to which the job is delegated. |
static java.lang.String |
MODULE_KEY
This key is needed to get the name of the module which created this Hashtable. |
private java.util.Hashtable |
propertyTable
Contains the properties of the current message. |
private static int |
REQUEST_ID
Generates the id number of the request corresponding to this MessageHashtable. |
static java.lang.String |
REQUEST_ID_KEY
This key is needed to get the id of this request. |
| Constructor Summary | |
MessageHashtable(java.lang.String module,
java.lang.String function)
Creates a new MessageHashtable for the given module and the given function. |
|
| Method Summary | |
void |
clear()
Clears this hashtable so that it contains no keys. |
boolean |
contains(java.lang.Object value)
Tests if some key maps into the specified value in this hashtable. |
boolean |
containsKey(java.lang.String key)
Tests if the specified object is a key in this hashtable. |
boolean |
containsValue(java.lang.Object value)
Returns true if this Hashtable maps one or more keys to this value. |
java.util.Enumeration |
elements()
Returns an enumeration of the values in this hashtable. |
java.lang.Object |
get(java.lang.String key)
Returns the value to which the specified key is mapped in this hashtable. |
java.util.Hashtable |
getProperties()
Returns the entire set of this message property. |
java.lang.String |
getProperty(java.lang.String propertyKey)
Returns a property defined by the givent key. |
boolean |
isEmpty()
Tests if this hashtable maps no keys to values. |
java.util.Enumeration |
keys()
Returns an enumeration of the keys in this hashtable. |
java.lang.Object |
put(java.lang.String key,
BinaryData value)
Maps the specified key to the specified value in this hashtable.
|
java.lang.Object |
put(java.lang.String key,
java.lang.String value)
Maps the specified key to the specified value in this hashtable.
|
java.lang.Object |
put(java.lang.String key,
java.lang.String[] value)
Maps the specified key to the specified value in this hashtable.
|
java.lang.Object |
put(java.lang.String key,
ValueHashtable value)
Maps the specified key to the specified value in this hashtable.
|
java.lang.Object |
remove(java.lang.String key)
Removes the key (and its corresponding value) from this hashtable. |
void |
setProperty(java.lang.String propertyKey,
java.lang.String value)
Sets a property |
int |
size()
Returns the number of keys in this hashtable. |
java.util.Hashtable |
toHashtable()
Return a hashtable representation of this object. |
java.lang.String |
toString()
Returns a String representation of this MessageHashtable and of the included values. |
| Methods inherited from class java.lang.Object |
|
| Field Detail |
private static int REQUEST_ID
public static final java.lang.String MODULE_KEY
public static final java.lang.String FUNCTION_KEY
public static final java.lang.String REQUEST_ID_KEY
public static final java.lang.String ACCEPTED_KEY
public static final java.lang.String COMMENT_KEY
private final java.util.Hashtable hashtable
private final java.util.Hashtable propertyTable
| Constructor Detail |
public MessageHashtable(java.lang.String module,
java.lang.String function)
module - The module which creates this MessageHashtable.function - The function which uses this MessageHashtable.| Method Detail |
public final java.util.Hashtable getProperties()
public final java.lang.String getProperty(java.lang.String propertyKey)
propertyKey - The key need to retreive the desired property.
public final void setProperty(java.lang.String propertyKey,
java.lang.String value)
propertyKey - The property key.value - The new property, can be nullpublic final void clear()
public final boolean contains(java.lang.Object value)
throws java.lang.NullPointerException
true if and only if some key maps to the value argument in this hashtable as determined by the equals method;
false otherwise.null.public final boolean containsKey(java.lang.String key)
true if and only if the specified object is a key in this hashtable, as determined by the equals method;
false otherwise.public final boolean containsValue(java.lang.Object value)
true if and only if some key maps to the value argument in this hashtable as determined by the equals method;
false otherwise.public final java.util.Enumeration elements()
public final java.lang.Object get(java.lang.String key)
null if the key is not mapped to any value in this hashtable.public final boolean isEmpty()
true if this hashtable maps no keys to values; false otherwise.public final java.util.Enumeration keys()
public final java.lang.Object put(java.lang.String key,
java.lang.String value)
throws java.lang.NullPointerException
value in this hashtable.
null.
The value can be retrieved by calling the get method with a key that is equal to the original key.
key - The hashtable key.value - The String value.null if it did not have one.null.
public final java.lang.Object put(java.lang.String key,
java.lang.String[] value)
throws java.lang.NullPointerException
value in this hashtable.
null.
The value can be retrieved by calling the get method with a key that is equal to the original key.
key - The hashtable key.value - The String[] value.null if it did not have one.null.
public final java.lang.Object put(java.lang.String key,
BinaryData value)
throws java.lang.NullPointerException
value in this hashtable.
null.
The value can be retrieved by calling the get method with a key that is equal to the original key.
key - The hashtable key.value - The BinaryData value.null if it did not have one.null.
public final java.lang.Object put(java.lang.String key,
ValueHashtable value)
throws java.lang.NullPointerException
value in this hashtable.
null.
The value can be retrieved by calling the get method with a key that is equal to the original key.
key - The hashtable key.value - The ValueHashtable value.null if it did not have one.null.
public final java.lang.Object remove(java.lang.String key)
key - the key that needs to be removed.null if the key did not have a mapping.public final int size()
public final java.util.Hashtable toHashtable()
public final java.lang.String toString()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||