com.ibm.dse.application
Class CounterElement

java.lang.Object
  |
  +--com.ibm.dse.base.DataElement
        |
        +--com.ibm.dse.base.DataField
              |
              +--com.ibm.dse.application.CounterElement

public class CounterElement
extends DataField

The CounterElement class derives from DataField.

It can be a total, an increment, or a totIncrs. It has four properties :

  1. - maxLimit : contains the maximum float value allowed for this counterElement.
  2. - minLimit : contains the minimum float value allowed for this counterElement.
  3. - checkIfRequired : a boolean that allows setting and increment.
  4. - parentCounter : holds a reference to his parent Counter.

See Also:
Serialized Form

Fields inherited from class com.ibm.dse.base.DataField
value
 
Fields inherited from class com.ibm.dse.base.DataElement
description, name, state
 
Constructor Summary
CounterElement()
          This constructor creates the CounterElement object.
CounterElement(java.lang.String aName)
          This constructor creates a new instance of the CounterElement class, which is obtained from the SGML definition files through aName).
 
Method Summary
 java.lang.Boolean getCheckIfRequired()
          Gets the checkIfRequired property (java.lang.Boolean) value.
 java.lang.Float getMaxLimit()
          Gets the maxLimit property (java.lang.Float) value.
 java.lang.Float getMinLimit()
          Gets the minLimit property (java.lang.Float) value.
 Counter getParentCounter()
          Gets the parentCounter property (Counters.Counter) value.
 java.lang.Object getValue()
          Gets the value property (java.lang.Object) value.
 java.lang.Object initializeFrom(Tag aTag)
          Returns the counterElement implemented by the Tag aTag.
 void setCheckIfRequired(java.lang.Boolean pCheckIfRequired)
          Sets the checkIfRequired property (java.lang.Boolean) value.
 void setMaxLimit(java.lang.Float pMaxLimit)
          Sets the maxLimit property (java.lang.Float) value.
 void setMinLimit(java.lang.Float pMinLimit)
          Sets the minLimit property (java.lang.Float) value.
 void setParentCounter(Counter pParentCounter)
          Sets the parentCounter property (Counters.Counter) value.
 java.lang.String toString()
          Returns a String representation of the counterElement.
 void tryMaxLimit(java.lang.Float aMax)
          Tests if the maxLimit aMax could be a correct maxLimit for the CounterElement.
 void tryMinLimit(java.lang.Float aMin)
          Tests if the MinLimit aMin is a correct minLimit for the CounterElement.
 void tryValue(java.lang.Float aValue)
          Tests if the value aValue is a correct value for the CounterElement.
 
Methods inherited from class com.ibm.dse.base.DataField
clone, nestedElements, nestedElements, nestedFields, readExternal, setValidValue, setValidValue, setValidValue, setValidValue, setValidValue, setValidValue, setValidValue, setValidValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, validate, validateState, writeExternal
 
Methods inherited from class com.ibm.dse.base.DataElement
externalizer, getDescription, getDescriptor, getElementAt, getErrorInfo, getExternalizer, getKey, getName, getState, getTagName, readExternal, readObject, removeElementAt, removeExternal, setDescription, setDescriptor, setErrorInfo, setExternalizer, setName, setState, toStrings, toTags, writeExternal
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CounterElement

public CounterElement()
This constructor creates the CounterElement object.

CounterElement

public CounterElement(java.lang.String aName)
               throws java.io.IOException
This constructor creates a new instance of the CounterElement class, which is obtained from the SGML definition files through aName).
Method Detail

getCheckIfRequired

public java.lang.Boolean getCheckIfRequired()
Gets the checkIfRequired property (java.lang.Boolean) value.

getMaxLimit

public java.lang.Float getMaxLimit()
Gets the maxLimit property (java.lang.Float) value.

getMinLimit

public java.lang.Float getMinLimit()
Gets the minLimit property (java.lang.Float) value.

getParentCounter

public Counter getParentCounter()
Gets the parentCounter property (Counters.Counter) value.

getValue

public java.lang.Object getValue()
Gets the value property (java.lang.Object) value.

The default value for any counterElement is a null Float.

Overrides:
getValue in class DataField
Tags copied from class: DataField
Returns:
The value property value.
See Also:
DataField.setValue(byte)

initializeFrom

public java.lang.Object initializeFrom(Tag aTag)
                                throws java.io.IOException
Returns the counterElement implemented by the Tag aTag.

This method throws an IOException if the externalizer hasn't been initialized.

Overrides:
initializeFrom in class DataField
Tags copied from class: DataField
Parameters:
aTag - Tag
Returns:
DataField

setCheckIfRequired

public void setCheckIfRequired(java.lang.Boolean pCheckIfRequired)
Sets the checkIfRequired property (java.lang.Boolean) value.

setMaxLimit

public void setMaxLimit(java.lang.Float pMaxLimit)
Sets the maxLimit property (java.lang.Float) value.

setMinLimit

public void setMinLimit(java.lang.Float pMinLimit)
Sets the minLimit property (java.lang.Float) value.

setParentCounter

public void setParentCounter(Counter pParentCounter)
Sets the parentCounter property (Counters.Counter) value.

toString

public java.lang.String toString()
Returns a String representation of the counterElement.
Overrides:
toString in class DataField
Tags copied from class: DataField
Returns:
java.lang.String

tryMaxLimit

public void tryMaxLimit(java.lang.Float aMax)
                 throws DSECounterException
Tests if the maxLimit aMax could be a correct maxLimit for the CounterElement.

Otherwise it throws a DSECounterException with "MaxOverValue" code.


tryMinLimit

public void tryMinLimit(java.lang.Float aMin)
                 throws DSECounterException
Tests if the MinLimit aMin is a correct minLimit for the CounterElement.

If it is not a correct minLimit, it throws a DSECounterException with "MinUnderValue" code.


tryValue

public void tryValue(java.lang.Float aValue)
              throws DSECounterException
Tests if the value aValue is a correct value for the CounterElement.

If it is not a correct value for the CounterElement, it throws a DSECounterException with "ValueOverMax" or "ValueUnderMin" code, depending on which limit was passed.