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 CountryHitCounter

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

@Entity
public final class CountryHitCounter
extends AbstractBasicEntity
implements ICount

Maps a counter to a country.
Used by:

.

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

Constructor Summary
protected CountryHitCounter()
          Deprecated. 
  CountryHitCounter(java.lang.String c)
          Creates a new CountryHitCounter with the given country.
  CountryHitCounter(java.lang.String c, int i)
          Creates a new CountryHitCounter with the given country and the given initial count.
 
Method Summary
 int getCount()
          Returns the value of the internal total.
 java.lang.String getCountry()
          Returns the country.
protected  void increase()
          Adds 1 to the internal total.
protected  void increaseBy(int count)
          Adds the given integer to the internal total.
 boolean isCountry(java.lang.String c)
          Test whether the given country-string matches the internal country.
 
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, toString, wait, wait, wait
 

Constructor Detail

CountryHitCounter

@Deprecated
protected CountryHitCounter()
Deprecated. 

Default constructor.


CountryHitCounter

public CountryHitCounter(java.lang.String c)
Creates a new CountryHitCounter with the given country.

Parameters:
c - the country

CountryHitCounter

public CountryHitCounter(java.lang.String c,
                         int i)
Creates a new CountryHitCounter with the given country and the given initial count.

Parameters:
c - the country
i - the value to initialise counter with
Throws:
java.lang.IllegalArgumentException - if c null or empty string
Method Detail

getCountry

public java.lang.String getCountry()
Returns the country.

Returns:
the country

isCountry

public boolean isCountry(java.lang.String c)
Test whether the given country-string matches the internal country.

Parameters:
c - the country
Returns:
true if and only if the internal country matches the given country-string, false otherwise

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.


increaseBy

protected void increaseBy(int count)
Adds the given integer to the internal total.

Parameters:
count - the integer to add