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 void
addElementFilter(java.lang.String filter)
adds an filter (element name or wildcard) to requested elements.void
addElementFilters(java.util.Collection<java.lang.String> filters)
adds more filters (element names or wildcards) to the requested elements.void
addElementType(MadxElementType madxElementType)
adds an MadxElementType to the filters.void
addElementTypes(java.util.Collection<MadxElementType> madxElementTypes)
adds more than one class filters to the request.void
addVariable(TwissVariable resultVariable)
adds a variable to the list of requested variables.void
addVariables(java.util.List<? extends TwissVariable> variables)
adds more variables to the Requeststatic TfsResultRequestImpl
createDefaultRequest()
This is a static factory method for a default result request.static TfsResultRequest
createSummaryOnlyRequest()
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()
boolean
needsPtcTwiss()
-
-
-
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:
getResultVariables
in interfaceTfsResultRequest
- Returns:
- the requeset resultVariables.
-
getElementPattern
public java.util.List<java.lang.String> getElementPattern()
- Specified by:
getElementPattern
in interfaceTfsResultRequest
- Returns:
- the requested element-filters.
-
getElementClasses
public java.util.List<java.lang.String> getElementClasses()
- Specified by:
getElementClasses
in 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
TfsResultRequestImpl
which 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
TfsResultRequestImpl
which is prepared to enable access of values via element name.
-
needsPtcTwiss
public boolean needsPtcTwiss()
- Specified by:
needsPtcTwiss
in interfaceTfsResultRequest
- Returns:
true
, if it is required to run a ptc-twiss to get the variables
-
-