cz.cuni.amis.nb.pogamut.base.introspection
Class PeriodicalTaskPerformer

Package class diagram package PeriodicalTaskPerformer
java.lang.Object
  extended by cz.cuni.amis.nb.pogamut.base.introspection.PeriodicalTaskPerformer

public abstract class PeriodicalTaskPerformer
extends Object

Object for performing some periodical task which can overload the CPU.

Author:
ik

Field Summary
protected static long MIN_UPDATE_GAP
          Minimal gap between two calls of taskDefinition().
protected  long timeOfLastUpdate
          Time of last call of taskDefinition().
 
Constructor Summary
PeriodicalTaskPerformer()
          Creates a new instance of PeriodicalTaskPerformer
 
Method Summary
 void performTask()
          Call this method if you want your task to be performed.
protected abstract  void taskDefinition()
          Definition of task to be performed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MIN_UPDATE_GAP

protected static long MIN_UPDATE_GAP
Minimal gap between two calls of taskDefinition().


timeOfLastUpdate

protected long timeOfLastUpdate
Time of last call of taskDefinition().

Constructor Detail

PeriodicalTaskPerformer

public PeriodicalTaskPerformer()
Creates a new instance of PeriodicalTaskPerformer

Method Detail

performTask

public void performTask()
Call this method if you want your task to be performed. If you will call this method too often (see MIN_UPDATE_GAP) the task won't be performed. This can save a lot of CPU time.


taskDefinition

protected abstract void taskDefinition()
Definition of task to be performed.



Copyright © 2015 AMIS research group, Faculty of Mathematics and Physics, Charles University in Prague, Czech Republic. All Rights Reserved.