gov.sns.xal.slg
Class Element

java.lang.Object
  |
  +--gov.sns.xal.slg.Element
All Implemented Interfaces:
java.lang.Cloneable, VisitorListener
Direct Known Subclasses:
Dipole, Drift, Octupole, Quadrupole, Sextupole, SkewQuad, SkewSext, ThinElement

public abstract class Element
extends java.lang.Object
implements VisitorListener, java.lang.Cloneable

The super class of all lattice elements.


Field Summary
static java.text.NumberFormat fmt
           
protected  boolean handleAsThick
           
 
Constructor Summary
protected Element(java.lang.String name, double position, double len)
          Creates a new instance of Element
 
Method Summary
abstract  void accept(Visitor v)
          When called with a Visitor reference the implementor can either reject to be visited (empty method body) or call the Visitor by passing its own object reference.
 java.lang.Object clone()
           
 AcceleratorNode getAcceleratorNode()
          The XAL AcceleratorNode property.
 double getBase()
          Return the base for relative positions.
 double getEndPosition()
          Return the downstream end position of this element
 java.lang.String getFam()
           
 double getLength()
          Return the length of this element in distance units.
 java.lang.String getName()
          Return the name of this element.
 double getPosition()
          Return the center position of this element
 double getStartPosition()
          Return the upstream start position of this element.
abstract  java.lang.String getType()
          Return the element type.
 boolean isThick()
          Is this really a thick element?
 void setAcceleratorNode(AcceleratorNode node)
          The XAL AcceleratorNode property.
 void setBase(double base)
          Set the base for relative positions.
 void setLength(double length)
          Set the element length.
 void setPosition(double position)
          Set the element's center position.
protected  java.util.ArrayList split(Element insert)
           
 double toAbsolutePosition(double position)
          Convert to absolute position
 java.lang.String toCoutString()
          Returns a printable string of this element.
static java.lang.String version()
          Return a version string wo the cvs keyword (i.e.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

fmt

public static java.text.NumberFormat fmt

handleAsThick

protected boolean handleAsThick
Constructor Detail

Element

protected Element(java.lang.String name,
                  double position,
                  double len)
Creates a new instance of Element

Method Detail

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Overrides:
clone in class java.lang.Object
java.lang.CloneNotSupportedException

setAcceleratorNode

public void setAcceleratorNode(AcceleratorNode node)
The XAL AcceleratorNode property.


getAcceleratorNode

public AcceleratorNode getAcceleratorNode()
The XAL AcceleratorNode property.


getType

public abstract java.lang.String getType()
Return the element type.


isThick

public boolean isThick()
Is this really a thick element?

Returns:
true if element is to be treated as a thick element, i.e. appended to the lattice in phase 1 of lattice generation; false if element is treated as a thin element; i.e. inserted in the lattice in phase 2 of lattice generation.

getStartPosition

public double getStartPosition()
Return the upstream start position of this element.


getEndPosition

public double getEndPosition()
Return the downstream end position of this element


getPosition

public double getPosition()
Return the center position of this element


toAbsolutePosition

public double toAbsolutePosition(double position)
Convert to absolute position


getLength

public double getLength()
Return the length of this element in distance units.


getName

public java.lang.String getName()
Return the name of this element.


getBase

public double getBase()
Return the base for relative positions.


setBase

public void setBase(double base)
Set the base for relative positions.


setPosition

public void setPosition(double position)
Set the element's center position.


setLength

public void setLength(double length)
Set the element length.


split

protected java.util.ArrayList split(Element insert)
                             throws LatticeError
LatticeError

toCoutString

public java.lang.String toCoutString()
Returns a printable string of this element.


getFam

public java.lang.String getFam()

version

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


accept

public abstract void accept(Visitor v)
When called with a Visitor reference the implementor can either reject to be visited (empty method body) or call the Visitor by passing its own object reference.

Specified by:
accept in interface VisitorListener