com.consultoriajava.browneater
Class Browner

java.lang.Object
  extended by com.consultoriajava.browneater.Browner
All Implemented Interfaces:
BrownOriginator
Direct Known Subclasses:
BigFatBrowner, MexicoDFBrowner, TajMajalBrowner

public class Browner
extends java.lang.Object
implements BrownOriginator

All the browners inherit from this class, objects created from this class has the ability to Brown every single being arround them.

Author:
consultoriajava.com

Constructor Summary
Browner()
           
 
Method Summary
 Brown expandBrown(Brown specification)
          Allows for the expansion of a brown.
 Brown generateBrown(java.lang.String description, int size)
          This method should be called when the Browner is up to generate a new Brown, the created brown will be returned to the calling method.
 java.lang.String getName()
          Retrieve the name of a Browner if the browner has been already identified.
 void preventBrowning()
          This method is usually called when a BrownIdentifier is trying to prevent a Browner from Browning any other people.
 void setName(java.lang.String name)
          Sets the name of a Browner, setting the name of a Browner is a good way of preventing him from generating new Browns.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Browner

public Browner()
Method Detail

generateBrown

public Brown generateBrown(java.lang.String description,
                           int size)
                    throws BrownerNotTrusted
This method should be called when the Browner is up to generate a new Brown, the created brown will be returned to the calling method.

Specified by:
generateBrown in interface BrownOriginator
Parameters:
description - The description of the Brown to be generated by the BrownGenerator.
size - The size of the Brown beeing created by this Originator
Returns:
The mercylessly generated brown
Throws:
BrownerNotTrusted - This exception is thrown if the Browner has been already identified, in such cases the API's dosent allows the browner to create more Browns.

expandBrown

public Brown expandBrown(Brown specification)
Description copied from interface: BrownOriginator
Allows for the expansion of a brown.

Specified by:
expandBrown in interface BrownOriginator
Parameters:
specification - The brown to be expanded
Returns:
The expanded brown

getName

public java.lang.String getName()
                         throws BrownerYetUndercoverException
Retrieve the name of a Browner if the browner has been already identified.

Returns:
The name of the browner
Throws:
BrownerYetUndercoverExcepcion
BrownerYetUndercoverException

setName

public void setName(java.lang.String name)
Sets the name of a Browner, setting the name of a Browner is a good way of preventing him from generating new Browns.

Parameters:
name - name of the Browner to be identified.

preventBrowning

public void preventBrowning()
                     throws BrownerYetUndercoverException
This method is usually called when a BrownIdentifier is trying to prevent a Browner from Browning any other people.

Throws:
BrownerYetUndercoverException - Launched when a Browner has not been yet identified, and so the Browing can not be prevented yet.