Class TfsSummaryImpl
- java.lang.Object
-
- cern.accsoft.steering.jmad.domain.result.tfs.TfsSummaryImpl
-
- All Implemented Interfaces:
TfsSummary
public class TfsSummaryImpl extends java.lang.Object implements TfsSummary
-
-
Constructor Summary
Constructors Constructor Description TfsSummaryImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addValue(java.lang.String madxName, java.lang.String value, MadxVarType varType)
adds a value to the summaryvoid
convert()
converts all the values that have VarType Double to double values, so that they can be retrieved quickly afterwards.java.lang.Double
getDoubleValue(GlobalVariable variable)
retrieve a double value for the given global variable.java.lang.Double
getDoubleValue(java.lang.String key)
Retrieve one of the Twiss Summary Values...java.util.Collection<java.lang.String>
getKeys()
java.lang.String
getStringValue(GlobalVariable variable)
Retrieves the String representation of the data for the given variable.java.lang.String
getStringValue(java.lang.String key)
Retrieves the String representation of the data for the given key.MadxVarType
getVarType(GlobalVariable variable)
the type for the variable in this summary.MadxVarType
getVarType(java.lang.String key)
the type of the value for the given keyjava.lang.String
toString()
-
-
-
Method Detail
-
addValue
public void addValue(java.lang.String madxName, java.lang.String value, MadxVarType varType)
adds a value to the summary- Parameters:
madxName
- the key of the valuevalue
- the value as stringvarType
- the type of the value
-
convert
public void convert() throws TfsResultException
converts all the values that have VarType Double to double values, so that they can be retrieved quickly afterwards.- Throws:
TfsResultException
- if the conversion fails
-
getDoubleValue
public java.lang.Double getDoubleValue(java.lang.String key)
Description copied from interface:TfsSummary
Retrieve one of the Twiss Summary Values...NOTE: Avoid this access. Better use
TfsSummary.getDoubleValue(GlobalVariable)
.- Specified by:
getDoubleValue
in interfaceTfsSummary
- Parameters:
key
- the name of the summary value to get- Returns:
- the value of this global parameter
- See Also:
TfsSummary.getDoubleValue(GlobalVariable)
-
getDoubleValue
public java.lang.Double getDoubleValue(GlobalVariable variable)
Description copied from interface:TfsSummary
retrieve a double value for the given global variable.This is the preferred way to access the data for double values!
- Specified by:
getDoubleValue
in interfaceTfsSummary
- Parameters:
variable
- the variable for which to get the value- Returns:
- the value
-
getKeys
public java.util.Collection<java.lang.String> getKeys()
- Specified by:
getKeys
in interfaceTfsSummary
- Returns:
- all the keys for which there exist values in this summary
-
getStringValue
public java.lang.String getStringValue(java.lang.String key)
Description copied from interface:TfsSummary
Retrieves the String representation of the data for the given key.NOTE: avoid this kind of data access! Use
TfsSummary.getStringValue(GlobalVariable)
instead whenever possible!- Specified by:
getStringValue
in interfaceTfsSummary
- Parameters:
key
- the key for which to get the data- Returns:
- the data as String
- See Also:
TfsSummary.getStringValue(GlobalVariable)
-
getStringValue
public java.lang.String getStringValue(GlobalVariable variable)
Description copied from interface:TfsSummary
Retrieves the String representation of the data for the given variable.This is the preferred way to access String data in the summary.
- Specified by:
getStringValue
in interfaceTfsSummary
- Parameters:
variable
- the variable for which to get the string representation of the value.- Returns:
- the String representation of the data
-
getVarType
public MadxVarType getVarType(java.lang.String key)
Description copied from interface:TfsSummary
the type of the value for the given key- Specified by:
getVarType
in interfaceTfsSummary
- Parameters:
key
- the key for which to query the type- Returns:
- the type for the key
-
getVarType
public MadxVarType getVarType(GlobalVariable variable)
Description copied from interface:TfsSummary
the type for the variable in this summary.- Specified by:
getVarType
in interfaceTfsSummary
- Parameters:
variable
- the variable for which to get the type- Returns:
- the type for the variable
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-