com.avian.birds.addbirds
Class Add5Bird

java.lang.Object
  extended by javax.swing.SwingWorker<java.lang.String,java.lang.String>
      extended by com.avian.birds.basebirds.AbstractBasicBird
          extended by com.avian.birds.basebirds.StdBird
              extended by com.avian.birds.addbirds.Add5Bird
All Implemented Interfaces:
java.lang.Runnable, java.util.concurrent.Future<java.lang.String>, java.util.concurrent.RunnableFuture<java.lang.String>

public class Add5Bird
extends StdBird

Eats a food object from the TupleTree, gets its contents, adds 5 to it, and then stores it back in the TupleTree. It can only add 5 to the contents - it can't do any other math operations or add any other amount. It typically eats a color food (BlackFood, GreenFood) but it could eat any type of food that uses a String for its contents.


Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.SwingWorker
javax.swing.SwingWorker.StateValue
 
Field Summary
 
Fields inherited from class com.avian.birds.basebirds.StdBird
foodFromTree, healthStatus, jbRefStart, jlRefLastAte, jtaRefHistory, jtfRefHealth, mts, myTupleTree, nts, sampleXmv, startButtonText
 
Fields inherited from class com.avian.birds.basebirds.AbstractBasicBird
bhf, bif, birdDesc, birdHistory, birdName, bof, eatsFood, hatchTime, historyFileName, inputFileName, lastAte, levelOfInfo, lifeTime, napLength, outputFileName, stamina, stopNow, storesFood
 
Constructor Summary
Add5Bird()
           
 
Method Summary
 void digest()
          Adds 5 to the value in the contents field and then takes a nap to simulate the performance of this app as if it were performing real work when digesting.
 void eatFood()
          Every Bird must eat food to stay alive and this method provides the instructions that this bird will follow to eat.
 
Methods inherited from class com.avian.birds.basebirds.StdBird
checkAge, done, setHealthRef, setHealthStatus, setHistoryAreaRef, setJlRefLastAte, setStartButtonRef, setStartButtonText, setTupleTree, storeFood
 
Methods inherited from class com.avian.birds.basebirds.AbstractBasicBird
addToBirdHistory, doInBackground, getAuxFood, getBirdDescription, getBirdHistory, getBirdName, getEatsFood, getHatchTime, getHistoryFileName, getInputFileName, getLastAte, getLevelOfInfo, getLifeTime, getNameOfFoodToStore, getNapLength, getOutputFileName, getStamina, isStopNow, setBhf, setBif, setBirdDesc, setBirdHistory, setBirdName, setBof, setEatsFood, setHatchTime, setHistoryFileName, setInputFileName, setLevelOfInfo, setLevelOfInfo, setLifeTime, setNapLength, setOutputFileName, setStamina, setStopNow, setStoresFood
 
Methods inherited from class javax.swing.SwingWorker
addPropertyChangeListener, cancel, execute, firePropertyChange, get, get, getProgress, getPropertyChangeSupport, getState, isCancelled, isDone, process, publish, removePropertyChangeListener, run, setProgress
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Add5Bird

public Add5Bird()
Method Detail

eatFood

public void eatFood()
Every Bird must eat food to stay alive and this method provides the instructions that this bird will follow to eat. If you tell it to eat from a file, it expects that to be a text file that contains just digits.

Overrides:
eatFood in class StdBird

digest

public void digest()
Adds 5 to the value in the contents field and then takes a nap to simulate the performance of this app as if it were performing real work when digesting.

Overrides:
digest in class StdBird