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 AbstractRegexVersionedCounter<T extends AbstractAggregation>

java.lang.Object
  extended by org.torweg.pulse.util.entity.AbstractBasicEntity
      extended by org.torweg.pulse.component.statistics.model.aggregation.AbstractRegexVersionedCounter<T>
Type Parameters:
T - the type of the AbstractAggregation the AbstractRegexVersionedCounter belongs to
All Implemented Interfaces:
java.io.Serializable, ICount
Direct Known Subclasses:
OperatingSystemVersionCounter, UserAgentVersionCounter

@MappedSuperclass
public abstract class AbstractRegexVersionedCounter<T extends AbstractAggregation>
extends AbstractBasicEntity
implements ICount

An abstract base class to derive a statistical data aggregation entity aggregating RegexVersions from. This would basically be the actual counter, counting the RegexVersions of the AbstractAggregation the AbstractRegexVersionedCounter belongs to.

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

Constructor Summary
AbstractRegexVersionedCounter()
           
 
Method Summary
 T getAggreation()
          Returns the "parent-"AbstractAggregation the AbstractRegexVersionedCounter belongs to.
 int getCount()
          Returns the value of the underlying counter.
 RegexVersion getVersion()
          Returns the underlying Version.
 void increase()
          Adds 1 to the internal counter.
 boolean isMatch(java.lang.String s)
          Checks the given string against the underlying version.
protected  void setAggreation(T aggregation)
          Sets the given AbstractAggregation for the AbstractRegexVersionedCounter.
protected  void setCounter(int count)
          Sets the internal counter to the given value.
protected  void setVersion(RegexVersion v)
          Sets the given Version.
 java.lang.String toString()
          Returns a string representation of the AbstractRegexVersionedCounter.
 
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

AbstractRegexVersionedCounter

public AbstractRegexVersionedCounter()
Method Detail

getAggreation

public final T getAggreation()
Returns the "parent-"AbstractAggregation the AbstractRegexVersionedCounter belongs to.

Returns:
the abstractAggregation

setAggreation

protected final void setAggreation(T aggregation)
Sets the given AbstractAggregation for the AbstractRegexVersionedCounter.

Parameters:
aggregation - the AbstractAggregation
Throws:
java.lang.NullPointerException - if
  • given aggregation is null

getCount

public final int getCount()
Returns the value of the underlying counter.

Specified by:
getCount in interface ICount
Returns:
the count.

setCounter

protected final void setCounter(int count)
Sets the internal counter to the given value.

Parameters:
count - the value to set
Throws:
java.lang.IllegalArgumentException - if
  • count < 0

getVersion

public final RegexVersion getVersion()
Returns the underlying Version.

Returns:
the version

setVersion

protected final void setVersion(RegexVersion v)
Sets the given Version.

Parameters:
v - the Version
Throws:
java.lang.NullPointerException - if
  • given version is null

increase

public final void increase()
Adds 1 to the internal counter.


isMatch

public final boolean isMatch(java.lang.String s)
Checks the given string against the underlying version.

Parameters:
s - the string to check
Returns:
true if the given match matches against the underlying version, false otherwise

toString

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

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