Class CustomVariableImpl
- java.lang.Object
-
- cern.accsoft.steering.jmad.domain.var.custom.CustomVariableImpl
-
- All Implemented Interfaces:
CustomVariable,MadxVariable,TwissVariable,Variable
public class CustomVariableImpl extends java.lang.Object implements CustomVariable
This class is the basic implementation of aCustomVariable
-
-
Constructor Summary
Constructors Constructor Description CustomVariableImpl(java.lang.String name, java.lang.String expression, java.lang.String comment, boolean lateAssigned)The constructor which enforces to give a name and the expression.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object other)java.lang.StringgetComment()The comment for this variable.java.lang.StringgetExpression()retrieve the expression of the variable.java.lang.StringgetKey()java.lang.StringgetMadxName()retrieve the name of the variable.java.lang.StringgetName()java.lang.StringgetUnit()java.lang.Class<?>getValueClass()the type of the values which this variable representsMadxVarTypegetVarType()inthashCode()booleanisApertureVariable()booleanisLateAssigned()java.lang.StringtoString()
-
-
-
Constructor Detail
-
CustomVariableImpl
public CustomVariableImpl(java.lang.String name, java.lang.String expression, java.lang.String comment, boolean lateAssigned)The constructor which enforces to give a name and the expression.- Parameters:
name- the name of the variableexpression- the expression defining the variable in madx.comment- a simple description of the variablelateAssigned- true, if assigned by ":=", false if assigned by ":".
-
-
Method Detail
-
getComment
public java.lang.String getComment()
Description copied from interface:CustomVariableThe comment for this variable. It is retrieved from the comment string in the same line as the variable definition. (If there is one)- Specified by:
getCommentin interfaceCustomVariable- Returns:
- a comment concerning this variable
-
getExpression
public java.lang.String getExpression()
Description copied from interface:CustomVariableretrieve the expression of the variable. (The string which is used to calculate the variable within madx)- Specified by:
getExpressionin interfaceCustomVariable- Returns:
- the expression as string
-
getMadxName
public java.lang.String getMadxName()
Description copied from interface:MadxVariableretrieve the name of the variable. This must be a unique expression within the madx model.- Specified by:
getMadxNamein interfaceMadxVariable- Returns:
- the name of the variable.
-
isLateAssigned
public boolean isLateAssigned()
- Specified by:
isLateAssignedin interfaceCustomVariable- Returns:
- true if the variable is defined by ":=", false if it is defined with "=".
-
isApertureVariable
public boolean isApertureVariable()
- Specified by:
isApertureVariablein interfaceTwissVariable- Returns:
- true, if this variable shall be plotted as aperture (second line with minus-sign)
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
equals
public boolean equals(java.lang.Object other)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
getKey
public java.lang.String getKey()
- Specified by:
getKeyin interfaceCustomVariable- Returns:
- a unified key
-
getUnit
public java.lang.String getUnit()
-
getVarType
public MadxVarType getVarType()
- Specified by:
getVarTypein interfaceMadxVariable- Returns:
- the type (String/Double) of the variable
-
getName
public java.lang.String getName()
-
getValueClass
public java.lang.Class<?> getValueClass()
Description copied from interface:Variablethe type of the values which this variable represents- Specified by:
getValueClassin interfaceVariable- Returns:
- The class of the values
-
-