com.rubecula.jquantity
Class Attributes

java.lang.Object
  extended byjava.util.AbstractMap
      extended byjava.util.HashMap
          extended bycom.rubecula.util.StringMap
              extended bycom.rubecula.util.AlphabeticalMap
                  extended bycom.rubecula.util.AttrMap
                      extended bycom.rubecula.jquantity.Attributes
All Implemented Interfaces:
java.lang.Cloneable, java.util.Map, java.io.Serializable

public class Attributes
extends AttrMap

Class

Since:
V_0_4
Version:
$Revision: 1.2 $
Author:
Robin Hillyard
See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class java.util.HashMap
 
Nested classes inherited from class java.util.AbstractMap
 
Field Summary
static java.lang.String $AttrBoolNormalize
          String: Normalize: value: Boolean Currently this is somewhat ambiguous - different classes use it to mean different things.
static java.lang.String $AttrBoolNotRatio
          Bool: NotRatio: value: Boolean: default Off
static java.lang.String $AttrBoolRound
          String: Round: value: Boolean
static java.lang.String $AttrBoolSymbolic
          String: Symbolic: value: Boolean
static java.lang.String $AttrBoolZero
          String: Zero: value: Boolean
static java.lang.String $AttrDoubleTolerance
          Double: Tolerance: value: Double
static java.lang.String $AttrIntPlaces
          String: Places: value: Integer
static java.lang.String $AttrIntRadix
          String: Radix: value: Integer
static java.lang.String $AttrStrDecimal
          String: Decimal: value: Decimal
static java.lang.String $AttrStrUnits
          String: Units: value: String
static java.lang.String $AttrStrUnitsIntrinsic
          String: UnitsIntrinsic: value: String
 
Fields inherited from class com.rubecula.util.AttrMap
$ValueOff, $ValueOn
 
Fields inherited from class java.util.HashMap
 
Fields inherited from class java.util.AbstractMap
 
Constructor Summary
Attributes()
           
 
Method Summary
 int getInt(java.lang.String key)
          Method to determine for this map the integer value of the attribute defined by key, or if the attribute is not present, a default value, determined according to the value of key.
 java.lang.String getString(java.lang.String key)
          Method to determine for this map the string value of the attribute defined by key, or if the attribute is not present, a default value, determined according to the value of key.
 boolean isOn(java.lang.String key)
          Method to determine if this map has the attribute defined by key turned on, or if the key is not present, return a default value based on the key.
 
Methods inherited from class com.rubecula.util.AttrMap
getDouble, getDouble, getInt, getString, isOn, setBoolean, setDouble, setInt
 
Methods inherited from class com.rubecula.util.AlphabeticalMap
contains, get, merge, put, toString
 
Methods inherited from class com.rubecula.util.StringMap
get, put, put
 
Methods inherited from class java.util.HashMap
clear, clone, containsKey, containsValue, entrySet, isEmpty, keySet, putAll, remove, size, values
 
Methods inherited from class java.util.AbstractMap
equals, hashCode
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Map
equals, hashCode
 

Field Detail

$AttrBoolNormalize

public static final java.lang.String $AttrBoolNormalize
String: Normalize: value: Boolean Currently this is somewhat ambiguous - different classes use it to mean different things.

See Also:
Constant Field Values

$AttrBoolRound

public static final java.lang.String $AttrBoolRound
String: Round: value: Boolean

See Also:
Constant Field Values

$AttrBoolZero

public static final java.lang.String $AttrBoolZero
String: Zero: value: Boolean

See Also:
Constant Field Values

$AttrIntPlaces

public static final java.lang.String $AttrIntPlaces
String: Places: value: Integer

See Also:
Constant Field Values

$AttrIntRadix

public static final java.lang.String $AttrIntRadix
String: Radix: value: Integer

See Also:
Constant Field Values

$AttrDoubleTolerance

public static final java.lang.String $AttrDoubleTolerance
Double: Tolerance: value: Double

See Also:
Constant Field Values

$AttrStrDecimal

public static final java.lang.String $AttrStrDecimal
String: Decimal: value: Decimal

See Also:
Constant Field Values

$AttrBoolNotRatio

public static final java.lang.String $AttrBoolNotRatio
Bool: NotRatio: value: Boolean: default Off

See Also:
Constant Field Values

$AttrStrUnits

public static final java.lang.String $AttrStrUnits
String: Units: value: String

See Also:
Constant Field Values

$AttrStrUnitsIntrinsic

public static final java.lang.String $AttrStrUnitsIntrinsic
String: UnitsIntrinsic: value: String

See Also:
Constant Field Values

$AttrBoolSymbolic

public static final java.lang.String $AttrBoolSymbolic
String: Symbolic: value: Boolean

See Also:
Constant Field Values
Constructor Detail

Attributes

public Attributes()
Method Detail

isOn

public boolean isOn(java.lang.String key)
Method to determine if this map has the attribute defined by key turned on, or if the key is not present, return a default value based on the key.

Overrides:
isOn in class AttrMap
Parameters:
key - the attribute being sought.
Returns:
if this map contains key, then its "on" state is returned, defaulting to true; otherwise, if key is $AttrNormalize return false; else if key is $AttrRound or $AttrZeroreturn true; failing that, return false.

getInt

public int getInt(java.lang.String key)
Method to determine for this map the integer value of the attribute defined by key, or if the attribute is not present, a default value, determined according to the value of key. This method is parallel to isOn(String).

Overrides:
getInt in class AttrMap
Parameters:
key - the attribute being sought.
Returns:
the integer value of the attribute defined by key or, if the attribute is not present in the map, then: if key is $AttrPlaces, then -1 (show all places); else if key is $AttrRadix, then 10; otherwise, return 0.

getString

public java.lang.String getString(java.lang.String key)
Method to determine for this map the string value of the attribute defined by key, or if the attribute is not present, a default value, determined according to the value of key. This method is parallel to isOn(String).

Overrides:
getString in class AttrMap
Parameters:
key - the attribute being sought.
Returns:
the string value of the attribute defined by key or, if the attribute is not present in the map, then: if key is $AttrDecimal, then "."; otherwise, return null.