Class Variable

java.lang.Object
com.strategyquant.tradinglib.Variable

public class Variable extends Object
The Class Variable.
  • Field Details

    • Log

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

      public static final byte TypeUnknown
      The Constant TypeUnknown.
      See Also:
      Constant Field Values
    • TypeInt

      public static final byte TypeInt
      The Constant TypeInt.
      See Also:
      Constant Field Values
    • TypeBoolean

      public static final byte TypeBoolean
      The Constant TypeBoolean.
      See Also:
      Constant Field Values
    • TypeString

      public static final byte TypeString
      The Constant TypeString.
      See Also:
      Constant Field Values
    • TypeDouble

      public static final byte TypeDouble
      The Constant TypeDouble.
      See Also:
      Constant Field Values
    • TypeTime

      public static final byte TypeTime
      The Constant TypeTime.
      See Also:
      Constant Field Values
    • TypeCustomParam

      public static final byte TypeCustomParam
      The Constant TypeCustomParam.
      See Also:
      Constant Field Values
    • DayTradeOn

      public static final String DayTradeOn
      The Constant DayTradeOn.
      See Also:
      Constant Field Values
  • Constructor Details

    • Variable

      public Variable(org.jdom2.Element elVariable)
      Instantiates a new variable.
      Parameters:
      elVariable - the el variable
    • Variable

      public Variable(String id, String name, String type, String value, boolean autoGenerated, boolean makeExternal)
      Instantiates a new variable.
      Parameters:
      id - the id
      name - the name
      type - the type
      value - the value
      autoGenerated - the auto generated
      makeExternal - the make external
    • Variable

      public Variable(String id, String name, String type, String value, boolean autoGenerated, String paramType, boolean makeExternal)
      Instantiates a new variable.
      Parameters:
      id - the id
      name - the name
      type - the type
      value - the value
      autoGenerated - the auto generated
      paramType - the param type
      makeExternal - the make external
    • Variable

      public Variable(Object object, Field field)
      Instantiates a new variable.
      Parameters:
      object - the object
      field - the field
  • Method Details

    • getId

      public String getId()
      Gets the id.
      Returns:
      the id
    • getValue

      public String getValue()
      Gets the value.
      Returns:
      the value
    • getName

      public String getName()
      Gets the name.
      Returns:
      the name
    • getType

      public String getType()
      Gets the type.
      Returns:
      the type
    • getInternalType

      public byte getInternalType()
      Gets the internal type.
      Returns:
      the internal type
    • getValueAsInt

      public int getValueAsInt()
      Gets the value as int.
      Returns:
      the value as int
    • getValueAsDouble

      public double getValueAsDouble()
      Gets the value as double.
      Returns:
      the value as double
    • getValueAsBoolean

      public boolean getValueAsBoolean()
      Gets the value as boolean.
      Returns:
      the value as boolean
    • registerAttachedField

      public void registerAttachedField(Object object, Field field)
      registers field that is attached to this variable.
      Parameters:
      object - the object
      field - the field
    • setValue

      public void setValue(int newValue)
      Sets the value.
      Parameters:
      newValue - the new value
    • setValue

      public void setValue(double newValue)
      Sets the value.
      Parameters:
      newValue - the new value
    • setValue

      public void setValue(boolean newValue)
      Sets the value.
      Parameters:
      newValue - the new value
    • setValue

      public void setValue(String newValue)
      Sets the value.
      Parameters:
      newValue - the new value
    • setValueInXml

      public void setValueInXml(double newValue)
      Sets the value in xml.
      Parameters:
      newValue - the new value in xml
    • setFromString

      public void setFromString(String newValue) throws Exception
      Sets the from string.
      Parameters:
      newValue - the new from string
      Throws:
      Exception - the exception
    • isObjectRegistered

      public boolean isObjectRegistered(Object object, String fieldName)
      Checks if is object registered.
      Parameters:
      object - the object
      fieldName - the field name
      Returns:
      true, if is object registered
    • translateType

      public String translateType(byte type)
      Translate type.
      Parameters:
      type - the type
      Returns:
      the string
    • getXML

      public org.jdom2.Element getXML()
      Gets the xml.
      Returns:
      the xml
    • isAutoGenerated

      public boolean isAutoGenerated()
      Checks if is auto generated.
      Returns:
      true, if is auto generated
    • getParamType

      public String getParamType()
      Gets the param type.
      Returns:
      the param type
    • setParamType

      public void setParamType(String paramType)
      Sets the param type.
      Parameters:
      paramType - the new param type
    • setMinMax

      public void setMinMax(double min, double max)
      Sets the min max.
      Parameters:
      min - the min
      max - the max
    • getMin

      public double getMin()
      Gets the min.
      Returns:
      the min
    • getMax

      public double getMax()
      Gets the max.
      Returns:
      the max
    • isMakeExternal

      public boolean isMakeExternal()
      Checks if is make external.
      Returns:
      true, if is make external
    • setMakeExternal

      public void setMakeExternal(boolean makeExternal)
      Sets the make external.
      Parameters:
      makeExternal - the new make external
    • toString

      public String toString()
      To string.
      Overrides:
      toString in class Object
      Returns:
      the string
    • getClone

      public Variable getClone()