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 boolean
equals(java.lang.Object other)
java.lang.String
getComment()
The comment for this variable.java.lang.String
getExpression()
retrieve the expression of the variable.java.lang.String
getKey()
java.lang.String
getMadxName()
retrieve the name of the variable.java.lang.String
getName()
java.lang.String
getUnit()
java.lang.Class<?>
getValueClass()
the type of the values which this variable representsMadxVarType
getVarType()
int
hashCode()
boolean
isApertureVariable()
boolean
isLateAssigned()
java.lang.String
toString()
-
-
-
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:CustomVariable
The 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:
getComment
in interfaceCustomVariable
- Returns:
- a comment concerning this variable
-
getExpression
public java.lang.String getExpression()
Description copied from interface:CustomVariable
retrieve the expression of the variable. (The string which is used to calculate the variable within madx)- Specified by:
getExpression
in interfaceCustomVariable
- Returns:
- the expression as string
-
getMadxName
public java.lang.String getMadxName()
Description copied from interface:MadxVariable
retrieve the name of the variable. This must be a unique expression within the madx model.- Specified by:
getMadxName
in interfaceMadxVariable
- Returns:
- the name of the variable.
-
isLateAssigned
public boolean isLateAssigned()
- Specified by:
isLateAssigned
in interfaceCustomVariable
- Returns:
- true if the variable is defined by ":=", false if it is defined with "=".
-
isApertureVariable
public boolean isApertureVariable()
- Specified by:
isApertureVariable
in interfaceTwissVariable
- Returns:
- true, if this variable shall be plotted as aperture (second line with minus-sign)
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object other)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
getKey
public java.lang.String getKey()
- Specified by:
getKey
in interfaceCustomVariable
- Returns:
- a unified key
-
getUnit
public java.lang.String getUnit()
-
getVarType
public MadxVarType getVarType()
- Specified by:
getVarType
in 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:Variable
the type of the values which this variable represents- Specified by:
getValueClass
in interfaceVariable
- Returns:
- The class of the values
-
-