gov.sns.xal.smf
Class AcceleratorSeqCombo

java.lang.Object
  |
  +--gov.sns.xal.smf.AcceleratorNode
        |
        +--gov.sns.xal.smf.AcceleratorSeq
              |
              +--gov.sns.xal.smf.AcceleratorSeqCombo
All Implemented Interfaces:
DataListener, ElementType
Direct Known Subclasses:
Ring

public class AcceleratorSeqCombo
extends AcceleratorSeq

The implementation of the accelerator combo sequence, This class is meant to deal with pasting together existing sequences into new sequences.


Field Summary
static java.lang.String s_strType
           
 
Fields inherited from class gov.sns.xal.smf.AcceleratorSeq
m_arrNodes, m_bucSequence, nodeTable
 
Fields inherited from class gov.sns.xal.smf.AcceleratorNode
channelSuite, m_bolIsSoft, m_bolStatus, m_bolValid, m_bucAlign, m_bucAper, m_bucTwiss, m_dblLen, m_dblPos, m_mapAttrs, m_objAccel, m_seqParent, m_strId
 
Constructor Summary
AcceleratorSeqCombo(java.lang.String strID, Accelerator accelerator, DataAdaptor adaptor)
          Constructor
AcceleratorSeqCombo(java.lang.String strID, java.util.List seqs)
          Primary constructor
 
Method Summary
 java.util.List getAllNodes()
          return all nodes, with filters on primary seqences
 java.util.List getBaseConstituents()
          Get the constituent sequences looking deeply even if the combo sequences are nested in many layers.
 java.util.List getBaseConstituentsWithQualifier(TypeQualifier qualifier)
          Get the constituent sequences looking deeply even if the combo sequences are nested in many layers.
 java.util.List getConstituentNames()
          gets the list of the names of the constituent seqnences
 java.util.List getConstituents()
          Get the constituent sequences.
 java.util.List getConstituentsWithQualifier(TypeQualifier qualifier)
          Get the constituent sequences that are matched by the qualifier.
static AcceleratorSeqCombo getInstance(java.lang.String strID, Accelerator accelerator, DataAdaptor adaptor)
          Instantiate a an AcceleratorSeqCombo or a subclass depending on whether the sequences form a ring.
static AcceleratorSeqCombo getInstance(java.lang.String strID, java.util.List sequences)
          Instantiate a an AcceleratorSeqCombo or a subclass depending on whether the sequences form a ring.
 double getLength()
          override the total length for this combo sequence
 java.util.List getNodes()
          Shallow fetch of nodes.
 AcceleratorNode getNodeWithId(java.lang.String label)
          Search deeply for and get the node with the specified id.
 double getPosition(AcceleratorNode node)
          get the position of a node in the sequence, including the extra length of the sequence starting position itself Note: this way could also be done in the parent AcceleratorSeq class, be we choose to use a more efficient scheme there, specfic to primary sequences.
protected static java.util.List getSequences(Accelerator accelerator, DataAdaptor adaptor)
           
 java.lang.String getType()
          Override to identify this sequence as a combo sequence
 
Methods inherited from class gov.sns.xal.smf.AcceleratorSeq
addBucket, addNode, addNodeAt, addSequenceChain, addSoft, canPrecede, contains, dataLabel, formsRing, getAllNodesOfType, getAllNodesWithQualifier, getAllSeqs, getIndexOfNode, getLeaves, getNodeAt, getNodeCount, getNodesOfType, getNodesWithQualifier, getNodesWithQualifier, getPredecessors, getSequence, getSequenceBuc, getSequences, indexToAddNode, isLinear, orderSequences, recurNodeSearch, recurSeqSearch, removeAllNodes, removeNode, setSequence, sortNodes, update, write
 
Methods inherited from class gov.sns.xal.smf.AcceleratorNode
channelSuite, clear, getAccelerator, getAlign, getAndConnectChannel, getAper, getBucket, getBuckets, getChannel, getHandles, getId, getParent, getPosition, getStatus, getTwiss, getValid, hasBucket, hasParent, isKindOf, isMagnet, lazilyGetAndConnect, removeFromParent, setAccelerator, setAlign, setAper, setLength, setParent, setPosition, setStatus, setTwiss, setValid, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

s_strType

public static final java.lang.String s_strType
See Also:
Constant Field Values
Constructor Detail

AcceleratorSeqCombo

public AcceleratorSeqCombo(java.lang.String strID,
                           java.util.List seqs)
Primary constructor


AcceleratorSeqCombo

public AcceleratorSeqCombo(java.lang.String strID,
                           Accelerator accelerator,
                           DataAdaptor adaptor)
Constructor

Method Detail

getInstance

public static AcceleratorSeqCombo getInstance(java.lang.String strID,
                                              java.util.List sequences)
Instantiate a an AcceleratorSeqCombo or a subclass depending on whether the sequences form a ring.

Parameters:
strID - The identifier of the new combo sequence
sequences - The sequences to flatten into a combo sequence
Returns:
a new AcceleratorSeqCombo instance if the sequences do not form a ring and a Ring if they do

getInstance

public static AcceleratorSeqCombo getInstance(java.lang.String strID,
                                              Accelerator accelerator,
                                              DataAdaptor adaptor)
Instantiate a an AcceleratorSeqCombo or a subclass depending on whether the sequences form a ring.

Parameters:
strID - The identifier of the new combo sequence
accelerator - The accelerator that holds to the sequences
adaptor - the data adaptor for specifying the sequences to combine
Returns:
a new AcceleratorSeqCombo instance if the sequences do not form a ring and a Ring if they do

getSequences

protected static java.util.List getSequences(Accelerator accelerator,
                                             DataAdaptor adaptor)

getType

public java.lang.String getType()
Override to identify this sequence as a combo sequence

Overrides:
getType in class AcceleratorSeq
Returns:
the combo sequence type identifier

getLength

public double getLength()
override the total length for this combo sequence

Overrides:
getLength in class AcceleratorSeq

getConstituentNames

public java.util.List getConstituentNames()
gets the list of the names of the constituent seqnences


getPosition

public double getPosition(AcceleratorNode node)
get the position of a node in the sequence, including the extra length of the sequence starting position itself Note: this way could also be done in the parent AcceleratorSeq class, be we choose to use a more efficient scheme there, specfic to primary sequences.

Overrides:
getPosition in class AcceleratorSeq
Parameters:
node - - the node for which the position is wanted

getNodeWithId

public AcceleratorNode getNodeWithId(java.lang.String label)
Search deeply for and get the node with the specified id. Overrides the inherited method to search down the path of the constituent sequences.

Overrides:
getNodeWithId in class AcceleratorSeq
Parameters:
label - The id of the node we are seeking.
Returns:
the node corresponding to the requested id or null if no such node is found.

getNodes

public java.util.List getNodes()
Shallow fetch of nodes. Override the AcceleratorSeq version to only return the list of nodes which are a union of those nodes which belong to the constituent sub-sequences.

Overrides:
getNodes in class AcceleratorSeq

getConstituents

public java.util.List getConstituents()
Get the constituent sequences.

Returns:
the list of constituent sequences that make the primary sequence

getConstituentsWithQualifier

public java.util.List getConstituentsWithQualifier(TypeQualifier qualifier)
Get the constituent sequences that are matched by the qualifier.

Parameters:
qualifier - The qualifier to restrict which constituents are returned
Returns:
the list of constituent sequences that make the combo sequence

getBaseConstituents

public java.util.List getBaseConstituents()
Get the constituent sequences looking deeply even if the combo sequences are nested in many layers.

Returns:
the list of constituent sequences that make the combo sequence

getBaseConstituentsWithQualifier

public java.util.List getBaseConstituentsWithQualifier(TypeQualifier qualifier)
Get the constituent sequences looking deeply even if the combo sequences are nested in many layers. Use the qualifier to limit the constituent sequences to only those which match the qualifier.

Parameters:
qualifier - The qualifier for matching which constituents get returned
Returns:
the list of qualified constituent sequences that make the combo sequence

getAllNodes

public java.util.List getAllNodes()
return all nodes, with filters on primary seqences

Overrides:
getAllNodes in class AcceleratorSeq