com.ibm.dse.application
Class Counter

java.lang.Object
  |
  +--com.ibm.dse.base.DataElement
        |
        +--com.ibm.dse.base.DataCollection
              |
              +--com.ibm.dse.base.KeyedCollection
                    |
                    +--com.ibm.dse.application.Counter

public class Counter
extends KeyedCollection

The Counter class derives from KeyedCollection.

It holds three CounterElements :

  1. - A Total.
  2. - An Increment.
  3. - A TotIncrs.

See Also:
Serialized Form

Fields inherited from class com.ibm.dse.base.DataElement
description, name, state
 
Constructor Summary
Counter()
          This constructor creates a Counter object.
Counter(java.lang.String aName)
          This constructor creates a new instance of the Counter class, which is obtained from the external definition files through aName.
 
Method Summary
 void add(CounterElement aCounterElement)
          Adds a CounterElement to the counter.
 java.lang.Boolean getCheckIfRequired()
          Returns the checkIfRequired property.
 java.lang.Float getIncrement()
          Returns the Increment value.
 java.lang.Float getIncrementMaxLimit()
          Returns the MaxLimit property of Increment CounterElement.
 java.lang.Float getIncrementMinLimit()
          Returns the MinLimit property of Increment CounterElement.
 java.lang.Float getTotal()
          Returns the Total value.
 java.lang.Float getTotalMaxLimit()
          Returns the MaxLimit property of Total CounterElement.
 java.lang.Float getTotalMinLimit()
          Returns the MinLimit property of Total CounterElement.
 java.lang.Float getTotIncrs()
          Returns the TotIncrs value.
 java.lang.Float getTotIncrsMaxLimit()
          Returns the MaxLimit property of TotIncrs CounterElement.
 java.lang.Float getTotIncrsMinLimit()
          Returns the MinLimit property of TotIncrs CounterElement.
 java.lang.Object getValueAt(java.lang.String aName)
          Returns the value of the CounterElement specified by aName.
 java.lang.Object initializeFrom(Tag aTag)
          Returns the counter implemented by the Tag aTag.
 void setCheckIfRequired(java.lang.Boolean aBoolean)
          Sets the CheckIfRequired property of the increment CounterElement.
 CounterElement setIncrement(java.lang.Float aFloat)
          Sets Increment value.
 void setIncrementMaxLimit(java.lang.Float aFloat)
          Sets the MaxLimit property of Increment.
 void setIncrementMinLimit(java.lang.Float aFloat)
          Sets the MinLimit property of Increment.
 CounterElement setTotal(java.lang.Float aFloat)
          Sets the value of Total.
 void setTotalMaxLimit(java.lang.Float aFloat)
          Sets the maxLimit property of Total.
 void setTotalMinLimit(java.lang.Float aFloat)
          Sets the minLimit property of Total.
 CounterElement setTotIncrs(java.lang.Float aFloat)
          Sets the value of TotIncrs.
 void setTotIncrsMaxLimit(java.lang.Float aFloat)
          Sets the maxLimit property of TotIncrs.
 void setTotIncrsMinLimit(java.lang.Float aFloat)
          Sets the minLimit property of TotIncrs.
 void setValueAt(java.lang.String aName, java.lang.Object aValue)
          Sets the value aValue as the value of the CounterElement named aName.
 Vector toStrings()
          Returns a Vector with a String representation of the counter.
 
Methods inherited from class com.ibm.dse.base.KeyedCollection
addElement, addElement, calculeNestedElements, calculeNestedQualifiedElements, clone, getDynamic, getElementAt, getElementAt, getElementAtAnyLevel, getElementAtFirstLevel, getElements, getEnumeration, getIndexOf, getIndexOf, getNestedElements, getOrder, getValue, isDynamic, readExternal, removeAll, removeElementAt, removeElementAt, removeElementAtFirstLevel, reorderElements, setDynamic, setElements, setOrder, setValue, setValueAt, size, toString, validate, writeExternal
 
Methods inherited from class com.ibm.dse.base.DataCollection
nestedElements, nestedElements, nestedFields, nestedKeyedCollections, nestedQualifiedElements
 
Methods inherited from class com.ibm.dse.base.DataElement
externalizer, getDescription, getDescriptor, getErrorInfo, getExternalizer, getKey, getName, getState, getTagName, readExternal, readObject, removeExternal, setDescription, setDescriptor, setErrorInfo, setExternalizer, setName, setState, toTags, writeExternal
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Counter

public Counter()
This constructor creates a Counter object.

Counter

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

add

public void add(CounterElement aCounterElement)
Adds a CounterElement to the counter.

getCheckIfRequired

public java.lang.Boolean getCheckIfRequired()
                                     throws DSEObjectNotFoundException
Returns the checkIfRequired property. If checkIfRequired is true the counter values for the increment field must be retrieved after every update.

This method throws a DSEObjectNotFoundException if the "increment" counterElement is not found.


getIncrement

public java.lang.Float getIncrement()
                             throws DSEObjectNotFoundException
Returns the Increment value.

This method throws a DSEObjectNotFoundException if the "increment" counterElement is not found.


getIncrementMaxLimit

public java.lang.Float getIncrementMaxLimit()
                                     throws DSEObjectNotFoundException
Returns the MaxLimit property of Increment CounterElement.

This method throws a DSEObjectNotFoundException if the "increment" counterElement is not found.


getIncrementMinLimit

public java.lang.Float getIncrementMinLimit()
                                     throws DSEObjectNotFoundException
Returns the MinLimit property of Increment CounterElement.

This method throws a DSEObjectNotFoundException if the "increment" counterElement is not found.


getTotal

public java.lang.Float getTotal()
                         throws DSEObjectNotFoundException
Returns the Total value.

This method throws a DSEObjectNotFoundException if the "total" counterElement is not found.


getTotalMaxLimit

public java.lang.Float getTotalMaxLimit()
                                 throws DSEObjectNotFoundException
Returns the MaxLimit property of Total CounterElement.

This method throws a DSEObjectNotFoundException if the "total" counterElement is not found.


getTotalMinLimit

public java.lang.Float getTotalMinLimit()
                                 throws DSEObjectNotFoundException
Returns the MinLimit property of Total CounterElement.

This method throws a DSEObjectNotFoundException if the "total" counterElement is not found.


getTotIncrs

public java.lang.Float getTotIncrs()
                            throws DSEObjectNotFoundException
Returns the TotIncrs value.

This method throws a DSEObjectNotFoundException if the "totIncrs" counterElement is not found.


getTotIncrsMaxLimit

public java.lang.Float getTotIncrsMaxLimit()
                                    throws DSEObjectNotFoundException
Returns the MaxLimit property of TotIncrs CounterElement.

This method throws a DSEObjectNotFoundException if the "totIncrs" counterElement is not found.


getTotIncrsMinLimit

public java.lang.Float getTotIncrsMinLimit()
                                    throws DSEObjectNotFoundException
Returns the MinLimit property of TotIncrs CounterElement.

This method throws a DSEObjectNotFoundException if the "totIncrs" counterElement is not found.


getValueAt

public java.lang.Object getValueAt(java.lang.String aName)
                            throws DSEObjectNotFoundException
Returns the value of the CounterElement specified by aName.

This method throws a DSEObjectNotFoundException if the aName counterElement is not found.

Overrides:
getValueAt in class DataCollection
Tags copied from class: DataCollection
Parameters:
aCompositeKey - java.lang.String
Returns:
java.lang.Object

initializeFrom

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

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

Overrides:
initializeFrom in class KeyedCollection
Tags copied from class: KeyedCollection
Parameters:
aTag - Tag
Returns:
java.lang.Object

setCheckIfRequired

public void setCheckIfRequired(java.lang.Boolean aBoolean)
                        throws DSEObjectNotFoundException
Sets the CheckIfRequired property of the increment CounterElement.

This method throws a DSEObjectNotFoundException if the "increment" counterElement is not found.


setIncrement

public CounterElement setIncrement(java.lang.Float aFloat)
                            throws DSECounterException,
                                   DSEObjectNotFoundException,
                                   DSEInvalidArgumentException
Sets Increment value.

It first tests if the value is correct then, if the value is correct, it sets it.

This method throws :

  1. - A DSEObjectNotFoundException if the "increment" counterElement is not found.
  2. - A DSECounterException if the value aFloat is not correct.
  3. - A DSEInvalidArgumentException when trying to set the value of a non-DataField component.

setIncrementMaxLimit

public void setIncrementMaxLimit(java.lang.Float aFloat)
                          throws DSECounterException,
                                 DSEObjectNotFoundException
Sets the MaxLimit property of Increment.

It first tests if the maxLimit value is correct then, if the maxLimit value is correct, it sets it.

This method throws :

  1. - A DSEObjectNotFoundException if the "increment" counterElement is not found.
  2. - A DSECounterException if the value aFloat is not correct.

setIncrementMinLimit

public void setIncrementMinLimit(java.lang.Float aFloat)
                          throws DSECounterException,
                                 DSEObjectNotFoundException
Sets the MinLimit property of Increment.

It first tests if the minLimit value is correct then, if the minLimit value is correct, it sets it.

This method throws :

  1. - A DSEObjectNotFoundException if the "increment" counterElement is not found.
  2. - A DSECounterException if the value aFloat is not correct.

setTotal

public CounterElement setTotal(java.lang.Float aFloat)
                        throws DSECounterException,
                               DSEObjectNotFoundException,
                               DSEInvalidArgumentException
Sets the value of Total.

It first tests if the value is correct then, if the value is correct, it sets it.

This method throws :

  1. - A DSEObjectNotFoundException if the "total" counterElement is not found.
  2. - A DSECounterException if the value aFloat is not correct.
  3. - A DSEInvalidArgumentException when trying to set the value of a non-DataField component.

setTotalMaxLimit

public void setTotalMaxLimit(java.lang.Float aFloat)
                      throws DSECounterException,
                             DSEObjectNotFoundException
Sets the maxLimit property of Total.

It first tests if the maxLimit value is correct then, if the maxLimit value is correct, it sets it.

This method throws :

  1. - A DSEObjectNotFoundException if the total counterElement is not found.
  2. - A DSECounterException if the value aFloat is not correct.

setTotalMinLimit

public void setTotalMinLimit(java.lang.Float aFloat)
                      throws DSECounterException,
                             DSEObjectNotFoundException
Sets the minLimit property of Total.

It first tests if the minLimit value is correct then, if the minLimit value is correct, it sets it.

This method throws :

  1. - A DSEObjectNotFoundException if the total counterElement is not found.
  2. - A DSECounterException if the value aFloat is not correct.

setTotIncrs

public CounterElement setTotIncrs(java.lang.Float aFloat)
                           throws DSECounterException,
                                  DSEObjectNotFoundException,
                                  DSEInvalidArgumentException
Sets the value of TotIncrs.

It first tests if the value is correct then, if the value is correct, it sets it.

This method throws :

  1. - A DSEObjectNotFoundException if the totIncrs counterElement is not found.
  2. - A DSECounterException if the value aFloat is not correct.
  3. - A DSEInvalidArgumentException when trying to set the value of a non-DataField component.

setTotIncrsMaxLimit

public void setTotIncrsMaxLimit(java.lang.Float aFloat)
                         throws DSECounterException,
                                DSEObjectNotFoundException
Sets the maxLimit property of TotIncrs.

It first tests if the maxLimit value is correct then, if the maxLimit value is correct, it sets it.

This method throws :

  1. - A DSEObjectNotFoundException if the totIncrs counterElement is not found.
  2. - A DSECounterException if the value aFloat is not correct.

setTotIncrsMinLimit

public void setTotIncrsMinLimit(java.lang.Float aFloat)
                         throws DSECounterException,
                                DSEObjectNotFoundException
Sets the minLimit property of TotIncrs.

It first tests if the minLimit value is correct then, if the minLimit value is correct, it sets it.

This method throws :

  1. - A DSEObjectNotFoundException if the totIncrs counterElement is not found.
  2. - A DSECounterException if the value aFloat is not correct.

setValueAt

public void setValueAt(java.lang.String aName,
                       java.lang.Object aValue)
                throws DSEObjectNotFoundException,
                       DSEInvalidArgumentException
Sets the value aValue as the value of the CounterElement named aName.

If the CounterElement that is set is the increment, it sets the new Total and TotIncrs Values.

The value aValue that is passed is considered correct and the set is always allowed.

This method throws :

  1. - A DSEObjectNotFoundException if the aName counterElement is not found.
  2. - A DSEInvalidArgumentException when trying to set the value of a non-DataField component.
Overrides:
setValueAt in class KeyedCollection
Tags copied from class: KeyedCollection
Parameters:
aName - java.lang.String
aKeyedCollection - KeyedCollection
aType - java.lang.String
Throws:
com.ibm.dse.base.DSEInvalidArgumentException. -  
com.ibm.dse.base.DSEObjectNotFoundException. -  

toStrings

public Vector toStrings()
Returns a Vector with a String representation of the counter. This method is an Externalizable interface method.
Overrides:
toStrings in class KeyedCollection
Tags copied from class: KeyedCollection
Returns:
Vector