Class AbstractElement

    • 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 MadX
        name - the name of the element.
    • Method Detail

      • getAttributeNames

        public java.util.List<java.lang.String> getAttributeNames()
        Specified by:
        getAttributeNames in interface Element
      • getMadxElementType

        public final MadxElementType getMadxElementType()
        Specified by:
        getMadxElementType in interface Element
        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
      • setAttribute

        public void setAttribute​(java.lang.String name,
                                 java.lang.Double value)
        Specified by:
        setAttribute in interface Element
      • 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 interface Element
        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.
      • getName

        public java.lang.String getName()
        Specified by:
        getName in interface Element
      • setPosition

        public void setPosition​(double position)
        Specified by:
        setPosition in interface Element
      • getLength

        public double getLength()
      • setLength

        public void setLength​(double length)
      • setAttributesInitialized

        public void setAttributesInitialized​(boolean attributesInitialized)
        Specified by:
        setAttributesInitialized in interface Element
      • setListenersEnabled

        public void setListenersEnabled​(boolean listenersEnabled)
        Specified by:
        setListenersEnabled in interface Element
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object