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 Details

    • Log

      public static final org.slf4j.Logger Log
      The Constant Log.
    • BYTE_MISSING

      public static final byte BYTE_MISSING
      The Constant BYTE_MISSING.
      See Also:
      Constant Field Values
    • INT_MISSING

      public static final int INT_MISSING
      The Constant INT_MISSING.
      See Also:
      Constant Field Values
    • LONG_MISSING

      public static final long LONG_MISSING
      The Constant LONG_MISSING.
      See Also:
      Constant Field Values
    • DOUBLE_MISSING

      public static final double DOUBLE_MISSING
      The Constant DOUBLE_MISSING.
      See Also:
      Constant Field Values
    • FLOAT_MISSING

      public static final float FLOAT_MISSING
      The Constant FLOAT_MISSING.
      See Also:
      Constant Field Values
  • Constructor Details

    • ValuesMap

      public ValuesMap()
  • Method Details

    • set

      public void set(int keyHash, Object value)
      Sets the.
      Parameters:
      keyHash - the key hash
      value - the value
    • set

      public void set(String key, Object value)
      Sets the.
      Parameters:
      key - the key
      value - the value
    • remove

      public void remove(int keyHash)
      Removes the.
      Parameters:
      keyHash - the key hash
    • get

      public Object get(String key)
      Gets the.
      Parameters:
      key - the key
      Returns:
      the object
    • get

      public Object get(int keyHash)
      Gets the.
      Parameters:
      keyHash - the key hash
      Returns:
      the object
    • get

      public Object get(String key, Object defaultValue)
      Gets the.
      Parameters:
      key - the key
      defaultValue - the default value
      Returns:
      the object
    • containsKey

      public boolean containsKey(String key)
      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

      public int getInt(String key)
      Gets the int.
      Parameters:
      key - the key
      Returns:
      the int
    • getBoolean

      public boolean getBoolean(String key)
      Gets the boolean.
      Parameters:
      key - the key
      Returns:
      the boolean
    • getLong

      public long getLong(String key)
      Gets the long.
      Parameters:
      key - the key
      Returns:
      the long
    • getLong

      public long getLong(String key, long defaultValue)
      Gets the long.
      Parameters:
      key - the key
      defaultValue - the default value
      Returns:
      the long
    • getInt

      public int getInt(String key, int defaultValue)
      Gets the int.
      Parameters:
      key - the key
      defaultValue - the default value
      Returns:
      the int
    • getString

      public String getString(String key)
      Gets the string.
      Parameters:
      key - the key
      Returns:
      the string
    • getString

      public String getString(String key, String defaultValue)
      Gets the string.
      Parameters:
      key - the key
      defaultValue - the default value
      Returns:
      the string
    • setString

      public void setString(String key, String value)
      Sets the string.
      Parameters:
      key - the key
      value - the value
    • getDouble

      public double getDouble(String key)
      Gets the double.
      Parameters:
      key - the key
      Returns:
      the double
    • getDouble

      public double getDouble(String key, double defaultValue)
      Gets the double.
      Parameters:
      key - the key
      defaultValue - the default value
      Returns:
      the double
    • getBoolean

      public boolean getBoolean(String key, boolean defaultValue)
      Gets the boolean.
      Parameters:
      key - the key
      defaultValue - the default value
      Returns:
      the boolean
    • fromJSON

      public static ValuesMap fromJSON(org.json.JSONObject json)
      From JSON.
      Parameters:
      json - the json
      Returns:
      the values map
    • toJSON

      public org.json.JSONObject toJSON()
      To JSON.
      Returns:
      the JSON object
    • getAllKeys

      public String[] 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 interface com.strategyquant.lib.settings.IXMLAble
      Returns:
      the xml
    • setFromXML

      public void setFromXML(org.jdom2.Element element)
      Sets the from XML.
      Specified by:
      setFromXML in interface com.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 element
      ignoredKeys - the ignored keys
    • removeIgnoredKeys

      public void removeIgnoredKeys(int[] ignoredKeys)
      Removes the ignored keys.
      Parameters:
      ignoredKeys - the ignored keys
    • clone

      public ValuesMap clone()
      Clone.
      Returns:
      the values map
    • hashCode

      public int hashCode()
      Hash code.
      Overrides:
      hashCode in class Object
      Returns:
      the int
    • getStatsIntKeyFromString

      public static int getStatsIntKeyFromString(String sKey)
      Gets the stats int key from string.
      Parameters:
      sKey - the s key
      Returns:
      the stats int key from string