gov.llnl.babel.symbols
Class Metadata
java.lang.Object
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".
Metadata(Date date) - This constructor for the
Metadata class takes a date
object as an argument.
|
Metadata(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.
|
void | addMetadata(String keyword, String value) - Add a (keyword,value) pair to the metadata description.
|
Date | getDate() - Return the
java.util.Date date associated with this symbol.
|
String | getDateAsString() - Return the date associated with this symbol as a string.
|
Map | getMetadataDatabase() - Retrieve the metadata database in the form of a
Map .
|
Set | getMetadataKeys() - Retrieve the set of keys from metadata database.
|
String | getMetadataValue(String keyword) - Retrieve the value associated with the specified keyword.
|
FORMAT
public static final String FORMAT
Metadata
public Metadata(Date date)
This constructor for the Metadata
class takes a date
object as an argument.
Metadata
public Metadata(String date)
throws 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.
addMetadata
public void addMetadata(String keyword,
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 Date getDate()
Return the java.util.Date
date associated with this symbol.
getDateAsString
public String getDateAsString()
Return the date associated with this symbol as a string.
getMetadataDatabase
public Map getMetadataDatabase()
Retrieve the metadata database in the form of a Map
.
The database consists of (keyword,value) pairs of strings.
getMetadataKeys
public Set getMetadataKeys()
Retrieve the set of keys from metadata database. Each of the keys
in the Set
is a string object.
getMetadataValue
public String getMetadataValue(String keyword)
Retrieve the value associated with the specified keyword. If the
keyword does not exist in the database, then a null is returned.