com.croftsoft.core.util.loop
Class FixedDelayLoopGovernor

java.lang.Object
  extended by com.croftsoft.core.util.loop.FixedDelayLoopGovernor
All Implemented Interfaces:
LoopGovernor

public final class FixedDelayLoopGovernor
extends Object
implements LoopGovernor

Maintains a periodic rate by stalling the loop by a fixed delay.

Since:
2002-03-07
Version:
2003-05-22
Author:
David Wallace Croft

Constructor Summary
FixedDelayLoopGovernor(double frequency)
          Constructs a LoopGovernor with the specified target frequency.
FixedDelayLoopGovernor(long delayMillis, int delayNanos)
           
 
Method Summary
 void govern()
          Stalls the current Thread by the fixed delay period.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FixedDelayLoopGovernor

public FixedDelayLoopGovernor(long delayMillis,
                              int delayNanos)

FixedDelayLoopGovernor

public FixedDelayLoopGovernor(double frequency)
Constructs a LoopGovernor with the specified target frequency.

Parameters:
frequency - The targeted loop frequency in loops per second.
Method Detail

govern

public void govern()
            throws InterruptedException
Stalls the current Thread by the fixed delay period.

Specified by:
govern in interface LoopGovernor
Throws:
InterruptedException

CroftSoft Javadoc

CroftSoft Core Javadoc (2008-09-28 20:58:02)