Package xal.smf.attr

Class AttributeBucket

java.lang.Object
xal.smf.attr.AttributeBucket
All Implemented Interfaces:
Serializable, DataListener
Direct Known Subclasses:
AlignmentBucket, ApertureBucket, BPMBucket, DisplaceBucket, FieldMapBucket, MagnetBucket, RfCavityBucket, RfGapBucket, RfqDummyBucket, RotationBucket, SequenceBucket, TwissBucket

public abstract class AttributeBucket extends Object implements Serializable, DataListener
The root class in the inheritance hierarchy of orthogonal sets of element attributes (such as a set of multipole harmonics, a set of aperture parameters, and others). Derived classes should call registerAttribute() in their constructor on all Attribute objects belonging to the attribute bucket.
Author:
Nikolay Malitsky, Christopher K. Allen
See Also:
  • Constructor Details

    • AttributeBucket

      protected AttributeBucket()
      AttributeBucket should only be instantiated by a derived class
  • Method Details

    • getType

      public abstract String getType()
      Derived class must furnish a unique type id
    • dataLabel

      public String dataLabel()
      implement DataListener interface
      Specified by:
      dataLabel in interface DataListener
      Returns:
      a tag that identifies the receiver's type
    • update

      public void update(DataAdaptor adaptor) throws NumberFormatException
      implement DataListener interface
      Specified by:
      update in interface DataListener
      Parameters:
      adaptor - The adaptor from which to update the data
      Throws:
      NumberFormatException
    • write

      public void write(DataAdaptor adaptor)
      implement DataListener interface
      Specified by:
      write in interface DataListener
      Parameters:
      adaptor - The adaptor to which the receiver's data is written
    • getAttr

      public Attribute getAttr(String strName)
    • getAttrDescription

      public String getAttrDescription(String strName)
    • getAttrNames

      public String[] getAttrNames()
    • parseAttrValue

      public boolean parseAttrValue(String strName, String strVal) throws NumberFormatException
      Throws:
      NumberFormatException
    • setAttrValue

      public boolean setAttrValue(String strName, int newVal)
    • setAttrValue

      public boolean setAttrValue(String strName, long newVal)
    • setAttrValue

      public boolean setAttrValue(String strName, float newVal)
    • setAttrValue

      public boolean setAttrValue(String strName, double newVal)
    • setAttrValue

      public boolean setAttrValue(String strName, String newVal)
    • setAttrValue

      public boolean setAttrValue(String strName, int[] newVal)
    • setAttrValue

      public boolean setAttrValue(String strName, long[] newVal)
    • setAttrValue

      public boolean setAttrValue(String strName, float[] newVal)
    • setAttrValue

      public boolean setAttrValue(String strName, double[] newVal)
    • setAttrValue

      public boolean setAttrValue(String strName, String[] newVal)
    • registerAttribute

      protected void registerAttribute(String strName, Attribute attr)
      Used by derived classes to define particular attributes
    • registerAttribute

      protected void registerAttribute(String strName, Attribute attr, String description)
      Used by derived classes to define particular attributes
    • checkAttribute

      protected boolean checkAttribute(String strName, int iType)
      Check attribute validity