gov.sns.xal.smf.attr
Class AttributeBucket

java.lang.Object
  |
  +--gov.sns.xal.smf.attr.AttributeBucket
All Implemented Interfaces:
DataListener, java.io.Serializable
Direct Known Subclasses:
AlignmentBucket, ApertureBucket, DisplaceBucket, MagnetBucket, RfCavityBucket, RfGapBucket, RotationBucket, SequenceBucket, TwissBucket

public abstract class AttributeBucket
extends java.lang.Object
implements java.io.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.

See Also:
Serialized Form

Nested Class Summary
static class AttributeBucket.MissingAttributeException
           
 
Constructor Summary
protected AttributeBucket()
          AttributeBucket should only be instantiated by a derived class
 
Method Summary
protected  boolean checkAttribute(java.lang.String strName, int iType)
          Check attribute validity
 java.lang.String dataLabel()
          implement DataListener interface
 Attribute getAttr(java.lang.String strName)
           
 java.lang.String[] getAttrNames()
           
abstract  java.lang.String getType()
          Derived class must furnish a unique type id
 boolean parseAttrValue(java.lang.String strName, java.lang.String strVal)
           
protected  void registerAttribute(java.lang.String strName, Attribute attr)
          Used by derived classes to define particular attributes
 boolean setAttrValue(java.lang.String strName, double newVal)
           
 boolean setAttrValue(java.lang.String strName, double[] newVal)
           
 boolean setAttrValue(java.lang.String strName, float newVal)
           
 boolean setAttrValue(java.lang.String strName, float[] newVal)
           
 boolean setAttrValue(java.lang.String strName, int newVal)
           
 boolean setAttrValue(java.lang.String strName, int[] newVal)
           
 boolean setAttrValue(java.lang.String strName, long newVal)
           
 boolean setAttrValue(java.lang.String strName, long[] newVal)
           
 boolean setAttrValue(java.lang.String strName, java.lang.String newVal)
           
 boolean setAttrValue(java.lang.String strName, java.lang.String[] newVal)
           
 void update(DataAdaptor adaptor)
          implement DataListener interface
 void write(DataAdaptor adaptor)
          implement DataListener interface
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AttributeBucket

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

Method Detail

getType

public abstract java.lang.String getType()
Derived class must furnish a unique type id


dataLabel

public java.lang.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 java.lang.NumberFormatException
implement DataListener interface

Specified by:
update in interface DataListener
Parameters:
adaptor - The adaptor from which to update the data
java.lang.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(java.lang.String strName)

getAttrNames

public java.lang.String[] getAttrNames()

parseAttrValue

public boolean parseAttrValue(java.lang.String strName,
                              java.lang.String strVal)
                       throws java.lang.NumberFormatException
java.lang.NumberFormatException

setAttrValue

public boolean setAttrValue(java.lang.String strName,
                            int newVal)

setAttrValue

public boolean setAttrValue(java.lang.String strName,
                            long newVal)

setAttrValue

public boolean setAttrValue(java.lang.String strName,
                            float newVal)

setAttrValue

public boolean setAttrValue(java.lang.String strName,
                            double newVal)

setAttrValue

public boolean setAttrValue(java.lang.String strName,
                            java.lang.String newVal)

setAttrValue

public boolean setAttrValue(java.lang.String strName,
                            int[] newVal)

setAttrValue

public boolean setAttrValue(java.lang.String strName,
                            long[] newVal)

setAttrValue

public boolean setAttrValue(java.lang.String strName,
                            float[] newVal)

setAttrValue

public boolean setAttrValue(java.lang.String strName,
                            double[] newVal)

setAttrValue

public boolean setAttrValue(java.lang.String strName,
                            java.lang.String[] newVal)

registerAttribute

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


checkAttribute

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