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
FieldsModifier and TypeFieldDescriptionstatic byteThe Constant BYTE_MISSING.static doubleThe Constant DOUBLE_MISSING.static floatThe Constant FLOAT_MISSING.static intThe Constant INT_MISSING.static org.slf4j.LoggerThe Constant Log.static longThe Constant LONG_MISSING. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Clear.clone()Clone.booleancontainsKey(int keyHash)Contains key.booleancontainsKey(String key)Contains key.static ValuesMapfromJSON(org.json.JSONObject json)From JSON.get(int keyHash)Gets the.Gets the.Gets the.String[]Gets the all keys.booleangetBoolean(String key)Gets the boolean.booleangetBoolean(String key, boolean defaultValue)Gets the boolean.doubleGets the double.doubleGets the double.intGets the int.intGets the int.longGets the long.longGets the long.static intgetStatsIntKeyFromString(String sKey)Gets the stats int key from string.Gets the string.Gets the string.org.jdom2.ElementgetXML()Gets the xml.inthashCode()Hash code.voidremove(int keyHash)Removes the.voidremoveIgnoredKeys(int[] ignoredKeys)Removes the ignored keys.voidRemoves the unsavable values.voidSets the.voidSets the.voidsetFromXML(org.jdom2.Element element)Sets the from XML.voidsetFromXML(org.jdom2.Element element, int[] ignoredKeys)Sets the from XML.voidSets the string.org.json.JSONObjecttoJSON()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:
getXMLin interfacecom.strategyquant.lib.settings.IXMLAble- Returns:
- the xml
-
setFromXML
public void setFromXML(org.jdom2.Element element)Sets the from XML.- Specified by:
setFromXMLin 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
-