pulse - the web application framework Get pulse at SourceForge.net. Fast, secure and Free Open Source software downloads Ohloh project report for pulse-java

org.torweg.pulse.component.statistics.model.aggregation
Class PIRecordCountAggregationHitCounter

java.lang.Object
  extended by org.torweg.pulse.util.entity.AbstractBasicEntity
      extended by org.torweg.pulse.component.statistics.model.aggregation.PIRecordCountAggregationHitCounter
All Implemented Interfaces:
java.io.Serializable, ICount

@Entity
public final class PIRecordCountAggregationHitCounter
extends AbstractBasicEntity
implements ICount

The hit counter of the PIRecordCountAggregation.

Version:
$Revision: 1555 $
Author:
Daniel Dietz
See Also:
Serialized Form

Constructor Summary
protected PIRecordCountAggregationHitCounter()
          Deprecated. 
  PIRecordCountAggregationHitCounter(AbstractAggregation.Hour h, Duration duration)
          Creates a new HitCounter with the given AbstractAggregation.Hour.
  PIRecordCountAggregationHitCounter(AbstractAggregation.Hour h, Duration duration, int c)
          Creates a new HitCounter with the given AbstractAggregation.Hour and the given initial count.
 
Method Summary
 int getCount()
          Returns the value of the internal total.
 Duration getDuration()
          Returns a Duration that represents the duration of the HitCounter.
 AbstractAggregation.Hour getHour()
          Returns the set AbstractAggregation.Hour.
protected  void increase()
          Adds 1 to the internal total.
 boolean isHour(AbstractAggregation.Hour h)
          Test whether the given AbstractAggregation.Hour matches the internal hour.
 java.lang.String toString()
          Returns a string representation.
 
Methods inherited from class org.torweg.pulse.util.entity.AbstractBasicEntity
compareTo, equals, getFullQualifiedClassNameJAXB, getId, hashCode
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PIRecordCountAggregationHitCounter

@Deprecated
protected PIRecordCountAggregationHitCounter()
Deprecated. 

Default constructor.


PIRecordCountAggregationHitCounter

public PIRecordCountAggregationHitCounter(AbstractAggregation.Hour h, Duration duration)
Creates a new HitCounter with the given AbstractAggregation.Hour.

Parameters:
h - the AbstractAggregation.Hour
duration - the Duration

PIRecordCountAggregationHitCounter

public PIRecordCountAggregationHitCounter(AbstractAggregation.Hour h, Duration duration,
                                          int c)
Creates a new HitCounter with the given AbstractAggregation.Hour and the given initial count.

Parameters:
h - the AbstractAggregation.Hour
duration - the Duration
c - the value to initialise counter with
Throws:
java.lang.IllegalArgumentException - if (c < 0)
Method Detail

getHour

public AbstractAggregation.Hour getHour()
Returns the set AbstractAggregation.Hour.

Returns:
the hour

isHour

public boolean isHour(AbstractAggregation.Hour h)
Test whether the given AbstractAggregation.Hour matches the internal hour.

Parameters:
h - the AbstractAggregation.Hour
Returns:
true if and only if the internal hour matches the given AbstractAggregation.Hour, false otherwise

getDuration

public Duration getDuration()
Returns a Duration that represents the duration of the HitCounter.

Returns:
a Duration

getCount

public int getCount()
Returns the value of the internal total.

Specified by:
getCount in interface ICount
Returns:
the total

increase

protected void increase()
Adds 1 to the internal total.


toString

public java.lang.String toString()
Returns a string representation.

Overrides:
toString in class java.lang.Object
Returns:
a string representation