datum.protocol
Class Library
java.lang.Object
|
+--datum.protocol.Library
- public final class Library
- extends Object
Catalogs all incoming data over a Connection, drops old data when new data with the
same message name comes in. Use the getLibrary method in a Connection instance to
get a reference to its Library. All the data in the Library is stored two layers deep.
The first layer is the message name layer. Each item in this layer is a Hashtable
which contains the fields of a single message. The second layer is the fields layer.
For each message name (Hashtable) you can request a specific field name.
- See Also:
Connection.getLibrary()
setHidden
public void setHidden(String messageName,
boolean hidden)
get
public String[] get()
- Gets an array of all the message names in the Library.
- Returns:
- An array containg the message names of the messages in the Library
get
public Hashtable get(String messageName)
- Returns all the fields from a specific message in a Hashtable. The message
being returned is the most recent one with that specific message name.
- Parameters:
messageName - The name of the message to retrieve- Returns:
- A Hashtable with the message's field names as the keys, null if not found
- See Also:
remove(java.lang.String)
remove
public Hashtable remove(String messageName)
- Removes the specified message from the Library. The message being removed
is returned, or a null is returned if there was no message in the Library
to remove.
- Parameters:
messageName - The name of the message to remove- Returns:
- The message that was removed, or null if the message name did not exist
- See Also:
get(java.lang.String)
get
public String get(String messageName,
String fieldName)
- Returns a particular field from a specific message. This can also be
accomplished by using Hashtable's get method on a Hashtable returned by the
get(java.lang.String) method. The value
being returned is the most recent one with that specific message name and field name.
- Parameters:
messageName - The name of the message to retrieve the field fromfieldName - The name of the field to retrieve- Returns:
- The value of the specified field, null if not found
getTime
public String getTime(String messageName,
String fieldName)
addUpdateListener
public void addUpdateListener(UpdateListener l)
removeUpdateListener
public void removeUpdateListener(UpdateListener l)