Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

alma::acs::logging::RepeatGuard Class Reference

List of all members.

Public Types

enum  Logic { AND, OR, TIMER, COUNTER }

Public Member Functions

 RepeatGuard (long interval, TimeUnit timeUnit, int maxRepetitions, Logic logic)
 RepeatGuard (long interval, TimeUnit timeUnit, int maxRepetitions)
synchronized boolean check ()
synchronized boolean checkAndIncrement ()
void reset (long interval, TimeUnit timeUnit, int maxRepetitions)
synchronized void reset (long interval, TimeUnit timeUnit, int maxRepetitions, Logic logic)
synchronized void reset ()
synchronized void increment ()
synchronized int counter ()
synchronized int count ()

Package Types


Private Attributes

Logic evaluationMethod
int maxRepetitions
long endTimeNs
long intervalNs
int counter
int counterAtLastCheck
boolean firstTime

Detailed Description

This is a copy from Nicolas' C++ RepeatGuard implementation. See there all the description, comments and documentation.

Author:
hmeuss


Member Enumeration Documentation

enum alma::acs::logging::RepeatGuard::Logic
 

Enumeration values:
AND 
OR 
TIMER 
COUNTER 


Constructor & Destructor Documentation

alma::acs::logging::RepeatGuard::RepeatGuard long  interval,
TimeUnit  timeUnit,
int  maxRepetitions,
Logic  logic
[inline]
 

Constructor.

Parameters:
interval Time interval (in timeUnit units).
timeUnit Time unit of interval parameter.
maxRepetitions Maximum number of repetitions.
logic Evaluation logic.

alma::acs::logging::RepeatGuard::RepeatGuard long  interval,
TimeUnit  timeUnit,
int  maxRepetitions
[inline]
 

Constructor, convenience for the above, using OR evaluation method.

Parameters:
interval Time interval (in timeUnit units).
timeUnit Time unit of interval parameter.
maxRepetitions Maximum number of repetitions.


Member Function Documentation

synchronized boolean alma::acs::logging::RepeatGuard::check  )  [inline]
 

Check returns true, if the last call for check was longer ago than interval and/or increment has been called more than maxRepetitions.

Returns:
true if OK, false if should be guarded

synchronized boolean alma::acs::logging::RepeatGuard::checkAndIncrement  )  [inline]
 

Increments and checks (see check()).

Returns:
true if OK, false if should be guarded
See also:
check()

synchronized int alma::acs::logging::RepeatGuard::count  )  [inline]
 

Get count at last check.

Returns:
count at last check.

synchronized int alma::acs::logging::RepeatGuard::counter  )  [inline]
 

Get current counter value.

Returns:
current counter value.

synchronized void alma::acs::logging::RepeatGuard::increment  )  [inline]
 

Increase couter value.

synchronized void alma::acs::logging::RepeatGuard::reset  )  [inline]
 

Reset and reconfigure logic of guard.

synchronized void alma::acs::logging::RepeatGuard::reset long  interval,
TimeUnit  timeUnit,
int  maxRepetitions,
Logic  logic
[inline]
 

Reset and reconfigure logic of guard.

Parameters:
interval Time interval (in timeUnit units).
timeUnit Time unit of interval parameter.
maxRepetitions Maximum number of repetitions.
logic Evaluation logic.

void alma::acs::logging::RepeatGuard::reset long  interval,
TimeUnit  timeUnit,
int  maxRepetitions
[inline]
 

Reset and reconfigure logic of guard using OR logic.

Parameters:
interval Time interval (in timeUnit units).
timeUnit Time unit of interval parameter.
maxRepetitions Maximum number of repetitions.


Member Data Documentation

int alma::acs::logging::RepeatGuard::counter [private]
 

int alma::acs::logging::RepeatGuard::counterAtLastCheck [private]
 

long alma::acs::logging::RepeatGuard::endTimeNs [private]
 

Logic alma::acs::logging::RepeatGuard::evaluationMethod [private]
 

boolean alma::acs::logging::RepeatGuard::firstTime [private]
 

long alma::acs::logging::RepeatGuard::intervalNs [private]
 

int alma::acs::logging::RepeatGuard::maxRepetitions [private]
 


The documentation for this class was generated from the following file:
Generated on Thu Apr 30 02:53:44 2009 for ACS Java API by doxygen 1.3.8