gov.sns.xal.slg
Class LatticeFactory

java.lang.Object
  |
  +--gov.sns.xal.slg.LatticeFactory

public class LatticeFactory
extends java.lang.Object

Factory to create a complete lattice from an XAL accelerator sequence or acclerator combo sequence.


Constructor Summary
LatticeFactory()
          Create a new instance of LatticeFactory with default element kinds.
LatticeFactory(java.util.ArrayList thickKinds, java.util.ArrayList thinKinds)
          Create a new instance of LatticeFactory.
 
Method Summary
static Lattice concatenate(Lattice left, Lattice right)
          Concatenate two lattices and generate the Node-to-Element dictionary for the resulting combined lattice.
 Lattice getLattice(AcceleratorSeq sequence)
          Return a lattice for an accelerator sequence.
 Lattice getLattice(AcceleratorSeqCombo sequence)
          Return a lattice for an accelerator sequence.
 void setDebug(boolean debug)
          Set debugging output to stdout.
 void setHalfMag(boolean halfmag)
          Set flag to force lattice generator to place a permanant marker in the middle of every thick element.
 void setHalfQuad(boolean halfquad)
          Alias for method setHalfMag()
 void setVerbose(boolean verbose)
          Set debugging output to verbose.
static java.lang.String version()
          Return a version string w/o the cvs keyword (i.e.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LatticeFactory

public LatticeFactory(java.util.ArrayList thickKinds,
                      java.util.ArrayList thinKinds)
Create a new instance of LatticeFactory.

Parameters:
thickKinds - : a list of strings of thick (and slim) element kinds. Example: ["DH","QH","QV","PQ","RG","BCM"].
thinKinds - : a list of strings of thin (and slim) element kinds. Example: ["DCH","DCV","RG","BCM","BPM","WS"].

LatticeFactory

public LatticeFactory()
Create a new instance of LatticeFactory with default element kinds. Kinds of thick (and slim) elements default to ["DH","QH","QV","PQ","RG","BCM"]. Kinds of thin (and slim) elements default to ["DCH","DCV","RG","BCM","BPM","WS"].

Method Detail

concatenate

public static Lattice concatenate(Lattice left,
                                  Lattice right)
                           throws LatticeError
Concatenate two lattices and generate the Node-to-Element dictionary for the resulting combined lattice. The concatenated lattice will be made of clones from the lattices given as input variables.

Parameters:
left - lattice in front of 'right'.
right - lattice behind 'left'.
Returns:
the concatenation lattice 'left+right'.
LatticeError

getLattice

public Lattice getLattice(AcceleratorSeqCombo sequence)
                   throws LatticeError
Return a lattice for an accelerator sequence.

Parameters:
sequence - the XAL combo sequence of the accelerator.
Returns:
The lattice.
LatticeError

getLattice

public Lattice getLattice(AcceleratorSeq sequence)
                   throws LatticeError
Return a lattice for an accelerator sequence.

Parameters:
sequence - the XAL sequence of the accelerator.
Returns:
The lattice.
Throws:
LatticeError.
LatticeError

setDebug

public void setDebug(boolean debug)
Set debugging output to stdout.

Parameters:
debug - true for output else false.

setVerbose

public void setVerbose(boolean verbose)
Set debugging output to verbose.

Parameters:
verbose - true for verbose output else false.

setHalfMag

public void setHalfMag(boolean halfmag)
Set flag to force lattice generator to place a permanant marker in the middle of every thick element.


setHalfQuad

public void setHalfQuad(boolean halfquad)
Alias for method setHalfMag()


version

public static java.lang.String version()
Return a version string w/o the cvs keyword (i.e. Id).