Class ElementAttribute
- java.lang.Object
-
- cern.accsoft.steering.jmad.domain.knob.AbstractKnob
-
- cern.accsoft.steering.jmad.domain.knob.attribute.ElementAttribute
-
- All Implemented Interfaces:
Knob
,MadxParameter
public class ElementAttribute extends AbstractKnob implements MadxParameter
this knob is a wrapper of the knob interface to element-attributes.
-
-
Constructor Summary
Constructors Constructor Description ElementAttribute(Element element, java.lang.String attributeName)
The constructor which requires both, an element and the attribute name
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static java.lang.String
createKey(Element element, java.lang.String attributeName)
creates a key for an given element and attribute-nameprotected void
doSetTotalValue(double value)
has to be implemented by subclass to set the total value to madx.static java.lang.String
getAttributeNameFromKey(java.lang.String key)
extracts the attribute-name from the keyjava.lang.String
getDescription()
static java.lang.String
getElementNameFromKey(java.lang.String key)
extracts the element-name from the keyjava.lang.String
getKey()
static KnobType
getKnobType()
java.lang.String
getMadxName()
java.lang.String
getName()
double
getTotalValue()
KnobType
getType()
-
Methods inherited from class cern.accsoft.steering.jmad.domain.knob.AbstractKnob
addListener, getOffset, getValue, removeListener, setOffset, setValue
-
-
-
-
Constructor Detail
-
ElementAttribute
public ElementAttribute(Element element, java.lang.String attributeName)
The constructor which requires both, an element and the attribute name- Parameters:
element
- the element instance to which the attribute belongsattributeName
- the name of the attribute
-
-
Method Detail
-
getDescription
public java.lang.String getDescription()
- Specified by:
getDescription
in interfaceKnob
- Returns:
- a description for this knob
-
getName
public java.lang.String getName()
-
doSetTotalValue
protected final void doSetTotalValue(double value)
Description copied from class:AbstractKnob
has to be implemented by subclass to set the total value to madx. The only call from this is from setTotalValue, which also notifies the listeners.- Specified by:
doSetTotalValue
in classAbstractKnob
- Parameters:
value
- the value to set
-
getTotalValue
public double getTotalValue()
- Specified by:
getTotalValue
in interfaceKnob
- Returns:
- the total value (value+offset)
-
getKey
public java.lang.String getKey()
-
getType
public KnobType getType()
-
getKnobType
public static KnobType getKnobType()
-
createKey
public static java.lang.String createKey(Element element, java.lang.String attributeName)
creates a key for an given element and attribute-name- Parameters:
element
- the element to use in the combined keyattributeName
- the name of the attribute to use in the combined key- Returns:
- a key which can be used in maps
-
getElementNameFromKey
public static java.lang.String getElementNameFromKey(java.lang.String key)
extracts the element-name from the key- Parameters:
key
- the key used in maps for element-attributes- Returns:
- the name of the element which is contained in the attribute-key
-
getAttributeNameFromKey
public static java.lang.String getAttributeNameFromKey(java.lang.String key)
extracts the attribute-name from the key- Parameters:
key
- the key from which to extract the attribute- Returns:
- the name of the attribute contained in the key
-
getMadxName
public java.lang.String getMadxName()
- Specified by:
getMadxName
in interfaceMadxParameter
- Returns:
- the name to be used in madx
-
-