com.consultoriajava.browneater
Class InternalBrownResolver

java.lang.Object
  extended by com.consultoriajava.browneater.BrownEater
      extended by com.consultoriajava.browneater.InternalBrownResolver
All Implemented Interfaces:
BrownerIdentifier

public class InternalBrownResolver
extends BrownEater
implements BrownerIdentifier

The InternalBrownResolver class identifies a BrownEater working within a company, they are extremally valuable object which are usually overloaded with work usually provoked by BrownOriginator within a company.

Author:
consultoriajava.com

Constructor Summary
InternalBrownResolver()
           
 
Method Summary
 void eatBrown(Brown brown)
          Method called when a Brown is supposed to be solved and killed or at least hibernated.
 Browner identifyBrowner(java.lang.Object potentialBrowner)
          This method allows the identification a given Browner from a given object
 boolean isAlreadySolvingAnotherBrown()
          Indicates if a InternalBrownResolver is already solving another
 void setAlreadySolvingAnotherBrown(boolean alreadySolvingAnotherBrown)
           
 
Methods inherited from class com.consultoriajava.browneater.BrownEater
getStress, increaseStress, reduceStress
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InternalBrownResolver

public InternalBrownResolver()
Method Detail

eatBrown

public void eatBrown(Brown brown)
              throws BrownRelatedException
Description copied from class: BrownEater
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.

Specified by:
eatBrown in class BrownEater
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.

identifyBrowner

public Browner identifyBrowner(java.lang.Object potentialBrowner)
Description copied from interface: BrownerIdentifier
This method allows the identification a given Browner from a given object

Specified by:
identifyBrowner in interface BrownerIdentifier
Parameters:
potentialBrowner - The object to be evaluated
Returns:
The identified Browner

isAlreadySolvingAnotherBrown

public boolean isAlreadySolvingAnotherBrown()
Indicates if a InternalBrownResolver is already solving another

Returns:
true if this BrownEater is already solving a brown and if so should not be overloaded with another or run risk of leaving the company.

setAlreadySolvingAnotherBrown

public void setAlreadySolvingAnotherBrown(boolean alreadySolvingAnotherBrown)