Class AbstractElement
- java.lang.Object
-
- cern.accsoft.steering.jmad.domain.elem.impl.AbstractElement
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
ATTR_LENGTH
the 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 void
addAttribute(java.lang.String attributeName)
adds an attribute to the available attributes of this elementvoid
addListener(ElementListener listener)
java.lang.Double
getAttribute(java.lang.String attributeName)
Retrieves the value of the attribute identified by the given name.java.util.List<java.lang.String>
getAttributeNames()
ElementAttributeReader
getAttributesReader()
double
getLength()
MadxElementType
getMadxElementType()
java.lang.String
getName()
Position
getPosition()
void
removeListener(ElementListener listener)
void
setAttribute(java.lang.String name, java.lang.Double value)
void
setAttributesInitialized(boolean attributesInitialized)
void
setAttributesReader(ElementAttributeReader attributesReader)
void
setLength(double length)
void
setListenersEnabled(boolean listenersEnabled)
void
setPosition(double position)
void
setPosition(Position position)
java.lang.String
toString()
-
-
-
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:
getAttributeNames
in interfaceElement
-
getMadxElementType
public final MadxElementType getMadxElementType()
- Specified by:
getMadxElementType
in 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:
addListener
in interfaceElement
-
removeListener
public void removeListener(ElementListener listener)
- Specified by:
removeListener
in interfaceElement
-
setAttribute
public void setAttribute(java.lang.String name, java.lang.Double value)
- Specified by:
setAttribute
in interfaceElement
-
getAttribute
public java.lang.Double getAttribute(java.lang.String attributeName)
Description copied from interface:Element
Retrieves the value of the attribute identified by the given name.- Specified by:
getAttribute
in 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:
getPosition
in interfaceElement
-
setPosition
public void setPosition(double position)
- Specified by:
setPosition
in interfaceElement
-
setPosition
public void setPosition(Position position)
- Specified by:
setPosition
in interfaceElement
-
getLength
public double getLength()
-
setLength
public void setLength(double length)
-
setAttributesInitialized
public void setAttributesInitialized(boolean attributesInitialized)
- Specified by:
setAttributesInitialized
in interfaceElement
-
setListenersEnabled
public void setListenersEnabled(boolean listenersEnabled)
- Specified by:
setListenersEnabled
in interfaceElement
-
setAttributesReader
public void setAttributesReader(ElementAttributeReader attributesReader)
-
getAttributesReader
public ElementAttributeReader getAttributesReader()
- Specified by:
getAttributesReader
in interfaceElement
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-