gov.llnl.babel.symbols
Class Metadata

java.lang.Object
  extended by gov.llnl.babel.symbols.Metadata

public class Metadata
extends java.lang.Object

The Metadata class represents the metadata associated with a symbol. Most of the data is represented as a hash table of keyword value pairs except for the required date attribute. The string version of the date is stored as "yyyyMMdd HH:mm:ss zzzz".


Field Summary
static java.lang.String FORMAT
           
 
Constructor Summary
Metadata(java.util.Date date)
          This constructor for the Metadata class takes a date object as an argument.
Metadata(java.lang.String date)
          This constructor for the Metadata class takes a date string as an argument and throws a ParseException if it is not in the proper format.
 
Method Summary
 void addMetadata(java.lang.String keyword, java.lang.String value)
          Add a (keyword,value) pair to the metadata description.
 java.util.Date getDate()
          Return the java.util.Date date associated with this symbol.
 java.lang.String getDateAsString()
          Return the date associated with this symbol as a string.
 java.util.Map getMetadataDatabase()
          Retrieve the metadata database in the form of a Map.
 java.util.Set getMetadataKeys()
          Retrieve the set of keys from metadata database.
 java.lang.String getMetadataValue(java.lang.String keyword)
          Retrieve the value associated with the specified keyword.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FORMAT

public static final java.lang.String FORMAT
See Also:
Constant Field Values
Constructor Detail

Metadata

public Metadata(java.lang.String date)
         throws java.text.ParseException
This constructor for the Metadata class takes a date string as an argument and throws a ParseException if it is not in the proper format.

Throws:
java.text.ParseException

Metadata

public Metadata(java.util.Date date)
This constructor for the Metadata class takes a date object as an argument.

Method Detail

addMetadata

public void addMetadata(java.lang.String keyword,
                        java.lang.String value)
Add a (keyword,value) pair to the metadata description. If the keyword already exists in the metadata database, then the old value will be over-written with the new value.


getDate

public java.util.Date getDate()
Return the java.util.Date date associated with this symbol.


getDateAsString

public java.lang.String getDateAsString()
Return the date associated with this symbol as a string.


getMetadataKeys

public java.util.Set getMetadataKeys()
Retrieve the set of keys from metadata database. Each of the keys in the Set is a string object.


getMetadataDatabase

public java.util.Map getMetadataDatabase()
Retrieve the metadata database in the form of a Map. The database consists of (keyword,value) pairs of strings.


getMetadataValue

public java.lang.String getMetadataValue(java.lang.String keyword)
Retrieve the value associated with the specified keyword. If the keyword does not exist in the database, then a null is returned.