com.consultoriajava.browneater
Class BrownEater

java.lang.Object
  extended by com.consultoriajava.browneater.BrownEater
Direct Known Subclasses:
ExternalBrownResolver, InternalBrownResolver

public abstract class BrownEater
extends java.lang.Object

Instances of this class have the ability to eat browns at the cost of increasing the ammount of stress generated.

Author:
consultoriajava.com

Constructor Summary
BrownEater()
           
 
Method Summary
abstract  void eatBrown(Brown brown)
          Method called when a Brown is supposed to be solved and killed or at least hibernated.
 int getStress()
          Return the numeric value of the acummulated stress
 void increaseStress()
          Artificially raises the stress of the brown eater
 void reduceStress()
          Artificially reduces the stress of the BrownEater
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BrownEater

public BrownEater()
Method Detail

reduceStress

public void reduceStress()
Artificially reduces the stress of the BrownEater


increaseStress

public void increaseStress()
Artificially raises the stress of the brown eater


getStress

public int getStress()
Return the numeric value of the acummulated stress

Returns:
The BrownEater stress level

eatBrown

public abstract void eatBrown(Brown brown)
                       throws BrownRelatedException
Method called when a Brown is supposed to be solved and killed or at least hibernated. This method must be overwritten by the extending class.

Parameters:
brown - Brown to be eated, and by extension, killed or hibernated.
Throws:
BrownRelatedException - Launched when there is a problem with the eating of a Brown.