edu.wpi.cs.dsrg.xmldb.xat.component.statisticsgatherer
Class IncrementValueByN

java.lang.Object
  |
  +--edu.wpi.cs.dsrg.xmldb.xat.common.operator.XATPropertiesImp
        |
        +--edu.wpi.cs.dsrg.xmldb.xat.common.operator.XATQueryObjectImp
              |
              +--edu.wpi.cs.dsrg.xmldb.xat.component.statisticsgatherer.StatisticsObject
                    |
                    +--edu.wpi.cs.dsrg.xmldb.xat.component.statisticsgatherer.IncrementValueByN

public class IncrementValueByN
extends StatisticsObject

This is the StatisticsObject used for any property that is incremented by some value. Calling calculateNewValue() will increment by 1. Calling calculateNewValue(String newValue) will increment by whatever int newValue encodes.

If you need to be able to decrement, you can pass "-1" If you need to increment based on some other property, then you have to make a seperate StatisticsObject for that purpose.

See Also:
Serialized Form

Fields inherited from class edu.wpi.cs.dsrg.xmldb.xat.common.operator.XATQueryObjectImp
stats, statsPresent
 
Constructor Summary
IncrementValueByN()
          TupleCountStatisticsObject constructor comment.
IncrementValueByN(java.lang.String name, XATQueryObject queryObject)
          TupleCountStatisticsObject constructor comment.
 
Method Summary
 void calculateNewValue()
          Calculates the new Value of the given property of this operator.
 void calculateNewValue(java.lang.String newValue)
          This is semantically the same as calculateNewValue(), but this provides a parameter which assists in the calculation.
 
Methods inherited from class edu.wpi.cs.dsrg.xmldb.xat.component.statisticsgatherer.StatisticsObject
compareTo, equals, getAssociatedQueryObject, getCategory, getPropertyName, getPropertyValue, setAssociatedQueryObject, setCategory, setPropertyName, setPropertyValue, toString
 
Methods inherited from class edu.wpi.cs.dsrg.xmldb.xat.common.operator.XATQueryObjectImp
addStatistic, getStatistics, isValidStatistic, setDefaultProperties, setDefaultStatistics
 
Methods inherited from class edu.wpi.cs.dsrg.xmldb.xat.common.operator.XATPropertiesImp
addProperty, getProperties, getProperty, isValidPropertyName, setNewPropertyValue, setProperty
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

IncrementValueByN

public IncrementValueByN()
TupleCountStatisticsObject constructor comment.

IncrementValueByN

public IncrementValueByN(java.lang.String name,
                         XATQueryObject queryObject)
TupleCountStatisticsObject constructor comment.
Parameters:
name - java.lang.String
queryObject - edu.wpi.cs.dsrg.xmldb.xat.common.operator.XATQueryObject
Method Detail

calculateNewValue

public void calculateNewValue()
Calculates the new Value of the given property of this operator. This should be overwritten by subclasses who can tailor this method to calculating 1 specific property.

This method should update at least the local propertyValue and possibly the value with the operator The entire StatisticsGatherer is available for assistance.

The procedure for calculating new values should be as follows:

  1. Consult the associatedOperator or statsTable for any propertyValues that are needed.
  2. Perform the required calculations using the propertyValues from step 1
  3. Update the local propertyValue.
  4. Update the property of the operator iff getCategory() == StatisticsGatherer.OVERALL and the property is an aggregate value. Otherwise, leave the operator property alone. This way the operator property's value's represent the OVERALL aggregate values.
  5. Update the lastTimeUpdated value by using lastTimeUpdated = System.currentTimeMillis();
Overrides:
calculateNewValue in class StatisticsObject

calculateNewValue

public void calculateNewValue(java.lang.String newValue)
This is semantically the same as calculateNewValue(), but this provides a parameter which assists in the calculation. Calculates the new Value of the given property of this operator. This should be overwritten by subclasses who can tailor this method to calculating 1 specific property.

This method should update at least the local propertyValue and possibly the value with the operator The entire StatisticsGatherer is available for assistance.

The procedure for calculating new values should be as follows:

  1. Consult the statsTable for any propertyValues that are needed.
  2. Perform the required calculations using the propertyValues from step 1
  3. Update the local propertyValue.
  4. Update the lastTimeUpdated value by using lastTimeUpdated = System.currentTimeMillis();
Overrides:
calculateNewValue in class StatisticsObject