Class AbstractElement
- java.lang.Object
-
- cern.accsoft.steering.jmad.domain.elem.impl.AbstractElement
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringATTR_LENGTHthe length of the element [m]-
Fields inherited from interface cern.accsoft.steering.jmad.domain.elem.Element
ATTR_SEPARATOR
-
-
Constructor Summary
Constructors Constructor Description AbstractElement(MadxElementType madxElementType, java.lang.String name)default constructor to enforce that the element has madx element type and a name.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddAttribute(java.lang.String attributeName)adds an attribute to the available attributes of this elementvoidaddListener(ElementListener listener)java.lang.DoublegetAttribute(java.lang.String attributeName)Retrieves the value of the attribute identified by the given name.java.util.List<java.lang.String>getAttributeNames()ElementAttributeReadergetAttributesReader()doublegetLength()MadxElementTypegetMadxElementType()java.lang.StringgetName()PositiongetPosition()voidremoveListener(ElementListener listener)voidsetAttribute(java.lang.String name, java.lang.Double value)voidsetAttributesInitialized(boolean attributesInitialized)voidsetAttributesReader(ElementAttributeReader attributesReader)voidsetLength(double length)voidsetListenersEnabled(boolean listenersEnabled)voidsetPosition(double position)voidsetPosition(Position position)java.lang.StringtoString()
-
-
-
Field Detail
-
ATTR_LENGTH
public static final java.lang.String ATTR_LENGTH
the length of the element [m]- See Also:
- Constant Field Values
-
-
Constructor Detail
-
AbstractElement
public AbstractElement(MadxElementType madxElementType, java.lang.String name)
default constructor to enforce that the element has madx element type and a name.- Parameters:
madxElementType- the type of the element, as it is represented in MadXname- the name of the element.
-
-
Method Detail
-
getAttributeNames
public java.util.List<java.lang.String> getAttributeNames()
- Specified by:
getAttributeNamesin interfaceElement
-
getMadxElementType
public final MadxElementType getMadxElementType()
- Specified by:
getMadxElementTypein interfaceElement- Returns:
- the exact element type as defined in the madx sequence of this element as enum
-
addAttribute
protected final void addAttribute(java.lang.String attributeName)
adds an attribute to the available attributes of this element- Parameters:
attributeName- the name of the attribute to add
-
addListener
public void addListener(ElementListener listener)
- Specified by:
addListenerin interfaceElement
-
removeListener
public void removeListener(ElementListener listener)
- Specified by:
removeListenerin interfaceElement
-
setAttribute
public void setAttribute(java.lang.String name, java.lang.Double value)- Specified by:
setAttributein interfaceElement
-
getAttribute
public java.lang.Double getAttribute(java.lang.String attributeName)
Description copied from interface:ElementRetrieves the value of the attribute identified by the given name.- Specified by:
getAttributein interfaceElement- Parameters:
attributeName- the name of the attribute to retrieve- Returns:
- the value of the attribute of the given name. If the attribute is not available for the element, then
null.
-
getPosition
public Position getPosition()
- Specified by:
getPositionin interfaceElement
-
setPosition
public void setPosition(double position)
- Specified by:
setPositionin interfaceElement
-
setPosition
public void setPosition(Position position)
- Specified by:
setPositionin interfaceElement
-
getLength
public double getLength()
-
setLength
public void setLength(double length)
-
setAttributesInitialized
public void setAttributesInitialized(boolean attributesInitialized)
- Specified by:
setAttributesInitializedin interfaceElement
-
setListenersEnabled
public void setListenersEnabled(boolean listenersEnabled)
- Specified by:
setListenersEnabledin interfaceElement
-
setAttributesReader
public void setAttributesReader(ElementAttributeReader attributesReader)
-
getAttributesReader
public ElementAttributeReader getAttributesReader()
- Specified by:
getAttributesReaderin interfaceElement
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-