gov.sns.xal.slg
Class Lattice

java.lang.Object
  |
  +--gov.sns.xal.slg.Lattice
All Implemented Interfaces:
java.lang.Cloneable

public class Lattice
extends java.lang.Object
implements java.lang.Cloneable

The lattice is a linear sequence of elements. Each element is associated with one and only one XAL AcceleratorNode object.


Field Summary
static double EPS
           
static java.text.NumberFormat fmt
           
 
Constructor Summary
Lattice(java.lang.String name)
          Creates an empty lattice with a 'name' and a 'base=0' position
Lattice(java.lang.String name, double base)
          Creates an empty lattice with a 'name' and a 'base' position.
Lattice(java.lang.String name, java.lang.Double base)
          Creates an empty lattice with a 'name' and a 'base' position
 
Method Summary
 void clearMarkers()
          Remove all non permanent marker elements from the lattice.
 java.lang.Object clone()
          Clone a lattice.
 double getBase()
          Return the lattice base position.
 Element getItem(int index)
          Get element at 'index' from lattice.
 org.w3c.dom.Document getLatticeAsDocument()
          Return the lattice as a DOM document object.
 double getLength()
          Return the lattice length in distance units.
 java.lang.String getName()
          Return the name property.
 Node2ElementMapper getNode2ElementMapper()
          Getter for the forward dictionary property: [(key,value)=(node,element)]
 void joinDrifts()
          Join neighbouring drift spaces into a single one.
 LatticeIterator latticeIterator()
          Return an iterator for the Lattice.
 int len()
          Return the lattice length in number of elements.
 Node2ElementMapper makeNode2ElementMapper()
          Make a new forward dictionary: [(key,value)=(node,element)].
 void setBase(double base)
          Set the lattice base position.
 void setName(java.lang.String name)
          Set the lattice name property.
 void setNode2ElementMapper(Node2ElementMapper node2ElementMap)
          Setter for the forward dictionary property: [(key,value)=(node,element)]
static java.lang.String version()
          Return a version string w/o the cvs keyword (i.e.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EPS

public static final double EPS

fmt

public static java.text.NumberFormat fmt
Constructor Detail

Lattice

public Lattice(java.lang.String name,
               double base)
Creates an empty lattice with a 'name' and a 'base' position.

Parameters:
name - the lattice name.
base - the lattice base position.

Lattice

public Lattice(java.lang.String name,
               java.lang.Double base)
Creates an empty lattice with a 'name' and a 'base' position


Lattice

public Lattice(java.lang.String name)
Creates an empty lattice with a 'name' and a 'base=0' position

Method Detail

getBase

public double getBase()
Return the lattice base position.


setBase

public void setBase(double base)
Set the lattice base position.


clone

public java.lang.Object clone()
Clone a lattice. The cloned lattice is a deep copied clone of the original.

Overrides:
clone in class java.lang.Object

len

public int len()
Return the lattice length in number of elements.


getItem

public Element getItem(int index)
Get element at 'index' from lattice.


getLength

public double getLength()
Return the lattice length in distance units.


setName

public void setName(java.lang.String name)
Set the lattice name property.


getName

public java.lang.String getName()
Return the name property.


setNode2ElementMapper

public void setNode2ElementMapper(Node2ElementMapper node2ElementMap)
Setter for the forward dictionary property: [(key,value)=(node,element)]


getNode2ElementMapper

public Node2ElementMapper getNode2ElementMapper()
Getter for the forward dictionary property: [(key,value)=(node,element)]


makeNode2ElementMapper

public Node2ElementMapper makeNode2ElementMapper()
Make a new forward dictionary: [(key,value)=(node,element)].

Returns:
The forward dictionary that maps accelerator nodes to lattice elements.

clearMarkers

public void clearMarkers()
Remove all non permanent marker elements from the lattice.


joinDrifts

public void joinDrifts()
Join neighbouring drift spaces into a single one.


version

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


latticeIterator

public LatticeIterator latticeIterator()
Return an iterator for the Lattice.


getLatticeAsDocument

public org.w3c.dom.Document getLatticeAsDocument()
Return the lattice as a DOM document object.