|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--gov.sns.xal.smf.AcceleratorNode
|
+--gov.sns.xal.smf.AcceleratorSeq
The implementation of the accelerator composite node, ordered collection of accelerator elements and sequences.
| Field Summary | |
protected java.util.List |
m_arrNodes
Container of nodes in this sequence |
protected SequenceBucket |
m_bucSequence
bucket for sequence parameters |
protected java.util.Map |
nodeTable
|
static java.lang.String |
s_strType
|
| 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 | |
AcceleratorSeq(java.lang.String strId)
base constructor |
|
AcceleratorSeq(java.lang.String strId,
int intReserve)
constructor that sets aside some space for nodes to come |
|
| Method Summary | |
void |
addBucket(AttributeBucket buc)
General attribute buckets support |
boolean |
addNode(AcceleratorNode newNode)
Method to move a node from one sequence to this sequence warning be careful - need to check node position when moving it about!! |
void |
addNodeAt(int iIndex,
AcceleratorNode node)
Add a node at a prescribed index |
protected java.util.List |
addSequenceChain(java.util.LinkedList orderedSequences,
java.util.Map sequenceMap)
Internal support for the oderSequences() method. |
protected boolean |
addSoft(AcceleratorSeq node)
Method to add a node from to this sequence the node is also kept in its original sequence. |
boolean |
canPrecede(AcceleratorSeq sequence)
Determine if this sequence can precede the one specified. |
boolean |
contains(AcceleratorNode node)
returns true if this sequences contains the node |
java.lang.String |
dataLabel()
support for the data adaptor - tap |
static boolean |
formsRing(java.util.List sequences)
Determing if the ordered list of sequences forms a closed loop. |
java.util.List |
getAllNodes()
deep fetch all nodes in this sequence |
java.util.List |
getAllNodesOfType(java.lang.String strTypeId)
deep fetch of nodes whose type is given by the string |
java.util.List |
getAllNodesWithQualifier(TypeQualifier qualifier)
deep fetch of nodes whose type is matched through the qualifier |
java.util.List |
getAllSeqs()
return a list of all sequences |
int |
getIndexOfNode(AcceleratorNode child)
returns the index of a node |
java.util.Iterator |
getLeaves()
|
double |
getLength()
Return the total length (m) of a sequence This is the length along the closed orbit |
AcceleratorNode |
getNodeAt(int iIndex)
returns the accelerator node at a prescribed index within this sequence |
int |
getNodeCount()
returns the number of nodes in this sequence |
java.util.List |
getNodes()
shallow fetch of nodes |
java.util.List |
getNodesOfType(java.lang.String strTypeId)
shallow fetch of nodes whose type is given by the string |
protected static java.util.List |
getNodesWithQualifier(java.util.List sourceNodes,
TypeQualifier qualifier)
fetch nodes whose type is matched through the qualifier |
java.util.List |
getNodesWithQualifier(TypeQualifier qualifier)
shallow fetch of nodes whose type is matched through the qualifier |
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 possible offset of a local sequence containing the node |
java.lang.String[] |
getPredecessors()
Return the allowed predecessor sequences of a sequence At most there can be 2 predecessors. |
AcceleratorSeq |
getSequence(java.lang.String strId)
Return a sequence whose id matches the argument and which is an immediate child of this sequence. |
SequenceBucket |
getSequenceBuc()
returns the bucket containing the sequence parameters - see attr. |
java.util.List |
getSequences()
Return the sequences that are immediate children of this sequence |
java.lang.String |
getType()
Support the node type |
protected int |
indexToAddNode(AcceleratorNode newNode)
Find the index to insert the node in increasing order of position. |
boolean |
isLinear()
Identify whether the sequence is within a linear section. |
static java.util.List |
orderSequences(java.util.Collection sequences)
Given a collection of sequences, order the sequences according to their predecessor attribute. |
protected void |
recurNodeSearch(java.util.LinkedList lstNodes,
AcceleratorSeq seqCurr)
Get all nodes in the specified sequence, look in all branches |
protected void |
recurSeqSearch(java.util.LinkedList lstSeqs,
AcceleratorSeq seqCurr)
Get all sequencess in the specified sequence, look in all branches |
void |
removeAllNodes()
|
boolean |
removeNode(AcceleratorNode node)
remove a node from this sequence |
void |
setSequence(SequenceBucket buc)
sets the bucket containing the twiss parameters - see attr.TwissBucket |
protected void |
sortNodes(java.util.LinkedList lstNodes)
method to sort nodes by position note: the position used is relative to the primary sequence |
void |
update(DataAdaptor adaptor)
DataListener interface - tap |
void |
write(DataAdaptor adaptor)
write the acceleratorSeq to the data adaptor |
| 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 |
public static final java.lang.String s_strType
protected SequenceBucket m_bucSequence
protected java.util.List m_arrNodes
protected java.util.Map nodeTable
| Constructor Detail |
public AcceleratorSeq(java.lang.String strId)
public AcceleratorSeq(java.lang.String strId,
int intReserve)
| Method Detail |
public void addBucket(AttributeBucket buc)
AcceleratorNode
addBucket in class AcceleratorNodepublic SequenceBucket getSequenceBuc()
public void setSequence(SequenceBucket buc)
public java.lang.String dataLabel()
dataLabel in interface DataListenerdataLabel in class AcceleratorNode
public void update(DataAdaptor adaptor)
throws java.lang.NumberFormatException
update in interface DataListenerupdate in class AcceleratorNodeadaptor - The adaptor from which to update the data
java.lang.NumberFormatExceptionpublic void write(DataAdaptor adaptor)
write in interface DataListenerwrite in class AcceleratorNodeadaptor - The adaptor to which the receiver's data is writtenpublic java.lang.String getType()
getType in class AcceleratorNodepublic int getNodeCount()
public int getIndexOfNode(AcceleratorNode child)
child - the node for which to get the indexpublic AcceleratorNode getNodeAt(int iIndex)
iIndex - the index for the node of interest (indexing starts with 0)protected int indexToAddNode(AcceleratorNode newNode)
public boolean addNode(AcceleratorNode newNode)
protected boolean addSoft(AcceleratorSeq node)
public boolean contains(AcceleratorNode node)
node - - the node to check
public void addNodeAt(int iIndex,
AcceleratorNode node)
throws java.lang.IndexOutOfBoundsException
iIndex - = the index to insert this nodenode - - the node to insert
java.lang.IndexOutOfBoundsExceptionpublic boolean removeNode(AcceleratorNode node)
node - the node to removepublic void removeAllNodes()
public AcceleratorNode getNodeWithId(java.lang.String label)
label - The id of the node we are seeking.
protected static java.util.List getNodesWithQualifier(java.util.List sourceNodes,
TypeQualifier qualifier)
public java.util.List getNodesOfType(java.lang.String strTypeId)
public java.util.List getNodesWithQualifier(TypeQualifier qualifier)
public java.util.List getAllNodesOfType(java.lang.String strTypeId)
public java.util.List getAllNodesWithQualifier(TypeQualifier qualifier)
public java.util.Iterator getLeaves()
public java.util.List getNodes()
public java.util.List getAllNodes()
public double getLength()
getLength in class AcceleratorNodepublic java.lang.String[] getPredecessors()
public boolean canPrecede(AcceleratorSeq sequence)
sequence - the sequence which we are testing if this sequence can precede
public static boolean formsRing(java.util.List sequences)
sequences - an ordered list of sequences to test for forming a ring
public static java.util.List orderSequences(java.util.Collection sequences)
throws SequenceOrderingException
SequenceOrderingException
protected java.util.List addSequenceChain(java.util.LinkedList orderedSequences,
java.util.Map sequenceMap)
public java.util.List getAllSeqs()
public AcceleratorSeq getSequence(java.lang.String strId)
public java.util.List getSequences()
public double getPosition(AcceleratorNode node)
node - - the node for which the position is wantedpublic boolean isLinear()
protected void sortNodes(java.util.LinkedList lstNodes)
protected void recurSeqSearch(java.util.LinkedList lstSeqs,
AcceleratorSeq seqCurr)
protected void recurNodeSearch(java.util.LinkedList lstNodes,
AcceleratorSeq seqCurr)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||