Class TfsResultRequestImpl
- java.lang.Object
-
- cern.accsoft.steering.jmad.domain.result.tfs.TfsResultRequestImpl
-
- All Implemented Interfaces:
TfsResultRequest
public class TfsResultRequestImpl extends java.lang.Object implements TfsResultRequest
this class provides a way to define, what results one wants to get back from a MadX twiss - Task.
-
-
Constructor Summary
Constructors Constructor Description TfsResultRequestImpl()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddElementFilter(java.lang.String filter)adds an filter (element name or wildcard) to requested elements.voidaddElementFilters(java.util.Collection<java.lang.String> filters)adds more filters (element names or wildcards) to the requested elements.voidaddElementType(MadxElementType madxElementType)adds an MadxElementType to the filters.voidaddElementTypes(java.util.Collection<MadxElementType> madxElementTypes)adds more than one class filters to the request.voidaddVariable(TwissVariable resultVariable)adds a variable to the list of requested variables.voidaddVariables(java.util.List<? extends TwissVariable> variables)adds more variables to the Requeststatic TfsResultRequestImplcreateDefaultRequest()This is a static factory method for a default result request.static TfsResultRequestcreateSummaryOnlyRequest()This is a static factory method for a special result request for an empty table.java.util.List<java.lang.String>getElementClasses()java.util.List<java.lang.String>getElementPattern()java.util.List<TwissVariable>getResultVariables()booleanneedsPtcTwiss()
-
-
-
Method Detail
-
addElementFilter
public void addElementFilter(java.lang.String filter)
adds an filter (element name or wildcard) to requested elements.- Parameters:
filter- the element name / wildcard
-
addElementFilters
public void addElementFilters(java.util.Collection<java.lang.String> filters)
adds more filters (element names or wildcards) to the requested elements.- Parameters:
filters- the names wildcards to add
-
addElementType
public void addElementType(MadxElementType madxElementType)
adds an MadxElementType to the filters. This represents an element-class in madx- Parameters:
madxElementType- the element type to add to the filters
-
addElementTypes
public void addElementTypes(java.util.Collection<MadxElementType> madxElementTypes)
adds more than one class filters to the request.- Parameters:
madxElementTypes- the MadX element types for which to request results
-
addVariable
public void addVariable(TwissVariable resultVariable)
adds a variable to the list of requested variables.- Parameters:
resultVariable- the variable to add
-
addVariables
public void addVariables(java.util.List<? extends TwissVariable> variables)
adds more variables to the Request- Parameters:
variables- the variables to add
-
getResultVariables
public java.util.List<TwissVariable> getResultVariables()
- Specified by:
getResultVariablesin interfaceTfsResultRequest- Returns:
- the requeset resultVariables.
-
getElementPattern
public java.util.List<java.lang.String> getElementPattern()
- Specified by:
getElementPatternin interfaceTfsResultRequest- Returns:
- the requested element-filters.
-
getElementClasses
public java.util.List<java.lang.String> getElementClasses()
- Specified by:
getElementClassesin interfaceTfsResultRequest- Returns:
- the requested element-classes
-
createSummaryOnlyRequest
public static final TfsResultRequest createSummaryOnlyRequest()
This is a static factory method for a special result request for an empty table. When this request is used for a twiss, then only the summary is returned.It works like this: Since madx does not know the class UNKNOWN and also not the column UNKNOWN it creates a twiss file, with only the summary table. This is useful in some cases.
This is not very nice. Maybe there is a better way to do this?
- Returns:
- a
TfsResultRequestImplwhich is ready to be used for twissing, resulting in the summary table only.
-
createDefaultRequest
public static final TfsResultRequestImpl createDefaultRequest()
This is a static factory method for a default result request. Only Name is already appended to the list of requested variables. This way it is ensured, that the TfsResult provides access via element names. The user only needs to append the elementFilters and additional variables required.- Returns:
- a
TfsResultRequestImplwhich is prepared to enable access of values via element name.
-
needsPtcTwiss
public boolean needsPtcTwiss()
- Specified by:
needsPtcTwissin interfaceTfsResultRequest- Returns:
true, if it is required to run a ptc-twiss to get the variables
-
-