cz.cuni.amis.utils
Class Heatup

Package class diagram package Heatup
java.lang.Object
  extended by cz.cuni.amis.utils.Heatup

public class Heatup
extends Object

This class allows you to easily setup heatup for any effect you need. I.e., something happens and you need to pursue some behavior/effect for amount of time. Just create heatup with specified amount of time "for the heat" and use isHot() to check whether you should still be using your behavior/effect.

To make your heatup hot, just call heat().

Author:
Jimmy

Constructor Summary
Heatup(long cooldownMillis)
           
Heatup(long cooldownTime, TimeUnit timeUnit)
           
 
Method Summary
 void clear()
          Removes the heat...
 long getRemainingTime()
          How much time we still have until the object becomes cold, i.e., !isHot().
 void heat()
          Force use of the effect == sets lastUsedMillis to current time.
 boolean isCool()
          Check whether we're cool == !isHot().
 boolean isHot()
          Check whether it is still hot.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Heatup

public Heatup(long cooldownMillis)

Heatup

public Heatup(long cooldownTime,
              TimeUnit timeUnit)
Method Detail

isHot

public boolean isHot()
Check whether it is still hot.

Returns:

heat

public void heat()
Force use of the effect == sets lastUsedMillis to current time.


getRemainingTime

public long getRemainingTime()
How much time we still have until the object becomes cold, i.e., !isHot().

Returns:

clear

public void clear()
Removes the heat...


isCool

public boolean isCool()
Check whether we're cool == !isHot().

Returns:


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