Package com.strategyquant.lib
Class ValuesMap
java.lang.Object
com.strategyquant.lib.ValuesMap
- All Implemented Interfaces:
com.strategyquant.lib.settings.IXMLAble
,Serializable
- Direct Known Subclasses:
Result
,SettingsMap
public class ValuesMap
extends Object
implements com.strategyquant.lib.settings.IXMLAble, Serializable
The Class ValuesMap.
- See Also:
- Serialized Form
-
Field Summary
Modifier and TypeFieldDescriptionstatic byte
The Constant BYTE_MISSING.static double
The Constant DOUBLE_MISSING.static float
The Constant FLOAT_MISSING.static int
The Constant INT_MISSING.static org.slf4j.Logger
The Constant Log.static long
The Constant LONG_MISSING. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
Clear.clone()
Clone.boolean
containsKey(int keyHash)
Contains key.boolean
containsKey(String key)
Contains key.static ValuesMap
fromJSON(org.json.JSONObject json)
From JSON.get(int keyHash)
Gets the.Gets the.Gets the.String[]
Gets the all keys.boolean
getBoolean(String key)
Gets the boolean.boolean
getBoolean(String key, boolean defaultValue)
Gets the boolean.double
Gets the double.double
Gets the double.int
Gets the int.int
Gets the int.long
Gets the long.long
Gets the long.static int
getStatsIntKeyFromString(String sKey)
Gets the stats int key from string.Gets the string.Gets the string.org.jdom2.Element
getXML()
Gets the xml.int
hashCode()
Hash code.void
remove(int keyHash)
Removes the.void
removeIgnoredKeys(int[] ignoredKeys)
Removes the ignored keys.void
Removes the unsavable values.void
Sets the.void
Sets the.void
setFromXML(org.jdom2.Element element)
Sets the from XML.void
setFromXML(org.jdom2.Element element, int[] ignoredKeys)
Sets the from XML.void
Sets the string.org.json.JSONObject
toJSON()
To JSON.
-
Field Details
-
Log
public static final org.slf4j.Logger LogThe Constant Log. -
BYTE_MISSING
public static final byte BYTE_MISSINGThe Constant BYTE_MISSING.- See Also:
- Constant Field Values
-
INT_MISSING
public static final int INT_MISSINGThe Constant INT_MISSING.- See Also:
- Constant Field Values
-
LONG_MISSING
public static final long LONG_MISSINGThe Constant LONG_MISSING.- See Also:
- Constant Field Values
-
DOUBLE_MISSING
public static final double DOUBLE_MISSINGThe Constant DOUBLE_MISSING.- See Also:
- Constant Field Values
-
FLOAT_MISSING
public static final float FLOAT_MISSINGThe Constant FLOAT_MISSING.- See Also:
- Constant Field Values
-
-
Constructor Details
-
ValuesMap
public ValuesMap()
-
-
Method Details
-
set
Sets the.- Parameters:
keyHash
- the key hashvalue
- the value
-
set
Sets the.- Parameters:
key
- the keyvalue
- the value
-
remove
public void remove(int keyHash)Removes the.- Parameters:
keyHash
- the key hash
-
get
Gets the.- Parameters:
key
- the key- Returns:
- the object
-
get
Gets the.- Parameters:
keyHash
- the key hash- Returns:
- the object
-
get
Gets the.- Parameters:
key
- the keydefaultValue
- the default value- Returns:
- the object
-
containsKey
Contains key.- Parameters:
key
- the key- Returns:
- true, if successful
-
containsKey
public boolean containsKey(int keyHash)Contains key.- Parameters:
keyHash
- the key hash- Returns:
- true, if successful
-
clear
public void clear()Clear. -
getInt
Gets the int.- Parameters:
key
- the key- Returns:
- the int
-
getBoolean
Gets the boolean.- Parameters:
key
- the key- Returns:
- the boolean
-
getLong
Gets the long.- Parameters:
key
- the key- Returns:
- the long
-
getLong
Gets the long.- Parameters:
key
- the keydefaultValue
- the default value- Returns:
- the long
-
getInt
Gets the int.- Parameters:
key
- the keydefaultValue
- the default value- Returns:
- the int
-
getString
Gets the string.- Parameters:
key
- the key- Returns:
- the string
-
getString
Gets the string.- Parameters:
key
- the keydefaultValue
- the default value- Returns:
- the string
-
setString
Sets the string.- Parameters:
key
- the keyvalue
- the value
-
getDouble
Gets the double.- Parameters:
key
- the key- Returns:
- the double
-
getDouble
Gets the double.- Parameters:
key
- the keydefaultValue
- the default value- Returns:
- the double
-
getBoolean
Gets the boolean.- Parameters:
key
- the keydefaultValue
- the default value- Returns:
- the boolean
-
fromJSON
From JSON.- Parameters:
json
- the json- Returns:
- the values map
-
toJSON
public org.json.JSONObject toJSON()To JSON.- Returns:
- the JSON object
-
getAllKeys
Gets the all keys.- Returns:
- the all keys
-
removeUnsavableValues
public void removeUnsavableValues()Removes the unsavable values. -
getXML
public org.jdom2.Element getXML()Gets the xml.- Specified by:
getXML
in interfacecom.strategyquant.lib.settings.IXMLAble
- Returns:
- the xml
-
setFromXML
public void setFromXML(org.jdom2.Element element)Sets the from XML.- Specified by:
setFromXML
in interfacecom.strategyquant.lib.settings.IXMLAble
- Parameters:
element
- the new from XML
-
setFromXML
public void setFromXML(org.jdom2.Element element, int[] ignoredKeys)Sets the from XML.- Parameters:
element
- the elementignoredKeys
- the ignored keys
-
removeIgnoredKeys
public void removeIgnoredKeys(int[] ignoredKeys)Removes the ignored keys.- Parameters:
ignoredKeys
- the ignored keys
-
clone
Clone.- Returns:
- the values map
-
hashCode
public int hashCode()Hash code. -
getStatsIntKeyFromString
Gets the stats int key from string.- Parameters:
sKey
- the s key- Returns:
- the stats int key from string
-