public class AttrDictionary
extends java.lang.Object
Constructor and Description |
---|
AttrDictionary()
Construct an empty attribution dictionary
|
Modifier and Type | Method and Description |
---|---|
void |
addEntries(AttrDictionary other) |
void |
finalize() |
java.lang.Object |
get(java.lang.String attrName)
Fetch an Object corresponding to the given attribute name.
|
AttrDictionaryEntry[] |
getArray(java.lang.String attrName)
Return an array of Entry objects, if the given attribute name
corresponds to an array.
|
boolean |
getBoolean(java.lang.String attrName)
Convert the given attribute to a boolean or return false if it's not there.
|
AttrDictionary |
getDict(java.lang.String attrName)
Fetch a dictionary corresponding to the given attribute name.
|
java.lang.Double |
getDouble(java.lang.String attrName)
Fetch a double corresponding to the given attribute name.
|
AttrDictionaryEntry |
getEntry(java.lang.String attrName)
Return a generic dictionary entry for the given attribute.
|
java.lang.Long |
getIdentity(java.lang.String attrName)
Fetch an identity corresponding to the given name.
|
java.lang.Integer |
getInt(java.lang.String attrName)
Return an Integer corresponding to the given attribute name.
|
java.lang.String[] |
getKeys()
Return all the top level attribute names.
|
java.lang.String |
getString(java.lang.String attrName)
Return a string corresponding to the given attribute name.
|
boolean |
hasField(java.lang.String attrName)
True if there's a field with the given name.
|
boolean |
parseFromJSON(java.lang.String json)
Parse from a JSON file.
|
void |
setArray(java.lang.String attrName,
AttrDictionary[] entries)
Assign the given array to the given attribute name.
|
void |
setArray(java.lang.String attrName,
AttrDictionaryEntry[] entries)
Assign the given array to the given attribute name.
|
void |
setDict(java.lang.String attrName,
AttrDictionary dict)
Assign the given dictionary to the given attribute name.
|
void |
setDouble(java.lang.String attrName,
double attrVal)
Set a double value.
|
void |
setInt(java.lang.String attrName,
int attrVal)
Set an int value.
|
void |
setString(java.lang.String attrName,
java.lang.String attrVal)
Set a string value.
|
java.lang.String |
toString() |
public boolean parseFromJSON(java.lang.String json)
public boolean hasField(java.lang.String attrName)
public java.lang.String getString(java.lang.String attrName)
attrName
- Name of the attribute we're looking for.public java.lang.Integer getInt(java.lang.String attrName)
attrName
- Name of the attribute we're looking for.public java.lang.Double getDouble(java.lang.String attrName)
attrName
- Name of the attribute we're looking for.public java.lang.Long getIdentity(java.lang.String attrName)
attrName
- Name of the attribute we're looking for.public boolean getBoolean(java.lang.String attrName)
public java.lang.Object get(java.lang.String attrName)
attrName
- Name of the attribute we're looking for.public AttrDictionary getDict(java.lang.String attrName)
attrName
- Name of the attribute we're looking for.public AttrDictionaryEntry getEntry(java.lang.String attrName)
public AttrDictionaryEntry[] getArray(java.lang.String attrName)
attrName
- Name of the attribute to get.public java.lang.String[] getKeys()
public void setString(java.lang.String attrName, java.lang.String attrVal)
attrName
- Name of the attribute to set.attrVal
- String value to set.public void setInt(java.lang.String attrName, int attrVal)
attrName
- Name of the attribute to set.attrVal
- Int value to set.public void setDouble(java.lang.String attrName, double attrVal)
attrName
- Name of the attribute to set.attrVal
- Double value to set.public void setDict(java.lang.String attrName, AttrDictionary dict)
public void setArray(java.lang.String attrName, AttrDictionaryEntry[] entries)
public void setArray(java.lang.String attrName, AttrDictionary[] entries)
public java.lang.String toString()
toString
in class java.lang.Object
public void addEntries(AttrDictionary other)
public void finalize()
finalize
in class java.lang.Object