Package com.strategyquant.tradinglib
Class Variable
java.lang.Object
com.strategyquant.tradinglib.Variable
The Class Variable.
-
Field Summary
Modifier and TypeFieldDescriptionstatic String
The Constant DayTradeOn.static org.slf4j.Logger
The Constant Log.static byte
The Constant TypeBoolean.static byte
The Constant TypeCustomParam.static byte
The Constant TypeDouble.static byte
The Constant TypeInt.static byte
The Constant TypeString.static byte
The Constant TypeTime.static byte
The Constant TypeUnknown. -
Constructor Summary
ConstructorDescriptionInstantiates a new variable.Variable(String id, String name, String type, String value, boolean autoGenerated, boolean makeExternal)
Instantiates a new variable.Variable(String id, String name, String type, String value, boolean autoGenerated, String paramType, boolean makeExternal)
Instantiates a new variable.Variable(org.jdom2.Element elVariable)
Instantiates a new variable. -
Method Summary
Modifier and TypeMethodDescriptiongetClone()
getId()
Gets the id.byte
Gets the internal type.double
getMax()
Gets the max.double
getMin()
Gets the min.getName()
Gets the name.Gets the param type.getType()
Gets the type.getValue()
Gets the value.boolean
Gets the value as boolean.double
Gets the value as double.int
Gets the value as int.org.jdom2.Element
getXML()
Gets the xml.boolean
Checks if is auto generated.boolean
Checks if is make external.boolean
isObjectRegistered(Object object, String fieldName)
Checks if is object registered.void
registerAttachedField(Object object, Field field)
registers field that is attached to this variable.void
setFromString(String newValue)
Sets the from string.void
setMakeExternal(boolean makeExternal)
Sets the make external.void
setMinMax(double min, double max)
Sets the min max.void
setParamType(String paramType)
Sets the param type.void
setValue(boolean newValue)
Sets the value.void
setValue(double newValue)
Sets the value.void
setValue(int newValue)
Sets the value.void
Sets the value.void
setValueInXml(double newValue)
Sets the value in xml.toString()
To string.translateType(byte type)
Translate type.
-
Field Details
-
Log
public static final org.slf4j.Logger LogThe Constant Log. -
TypeUnknown
public static final byte TypeUnknownThe Constant TypeUnknown.- See Also:
- Constant Field Values
-
TypeInt
public static final byte TypeIntThe Constant TypeInt.- See Also:
- Constant Field Values
-
TypeBoolean
public static final byte TypeBooleanThe Constant TypeBoolean.- See Also:
- Constant Field Values
-
TypeString
public static final byte TypeStringThe Constant TypeString.- See Also:
- Constant Field Values
-
TypeDouble
public static final byte TypeDoubleThe Constant TypeDouble.- See Also:
- Constant Field Values
-
TypeTime
public static final byte TypeTimeThe Constant TypeTime.- See Also:
- Constant Field Values
-
TypeCustomParam
public static final byte TypeCustomParamThe Constant TypeCustomParam.- See Also:
- Constant Field Values
-
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 idname
- the nametype
- the typevalue
- the valueautoGenerated
- the auto generatedmakeExternal
- 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 idname
- the nametype
- the typevalue
- the valueautoGenerated
- the auto generatedparamType
- the param typemakeExternal
- the make external
-
Variable
Instantiates a new variable.- Parameters:
object
- the objectfield
- the field
-
-
Method Details
-
getId
Gets the id.- Returns:
- the id
-
getValue
Gets the value.- Returns:
- the value
-
getName
Gets the name.- Returns:
- the name
-
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
registers field that is attached to this variable.- Parameters:
object
- the objectfield
- 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
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
Sets the from string.- Parameters:
newValue
- the new from string- Throws:
Exception
- the exception
-
isObjectRegistered
Checks if is object registered.- Parameters:
object
- the objectfieldName
- the field name- Returns:
- true, if is object registered
-
translateType
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
Gets the param type.- Returns:
- the param type
-
setParamType
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 minmax
- 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
To string. -
getClone
-