com.avian.birds.db
Class CombineBird

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.db.CombineBird
All Implemented Interfaces:
java.lang.Runnable, java.util.concurrent.Future<java.lang.String>, java.util.concurrent.RunnableFuture<java.lang.String>

public class CombineBird
extends StdBird


Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.SwingWorker
javax.swing.SwingWorker.StateValue
 
Field Summary
 java.lang.String auxFood
          Xmv annotated variable that allows you to set the name of the second food that this bird eats.
 java.lang.String dbDriver
          Xmv annotated variable that allows you to select the database driver at runtime.
 java.lang.String dbLogin
          Xmv annotated variable that allows you to select the login name at runtime.
 java.lang.String dbName
          Xmv annotated variable that allows you to select the database at runtime.
 java.lang.String dbPW
          Xmv annotated variable that allows you to select the password at runtime.
 java.lang.String dbSQLStatement
          Xmv annotated variable that allows you to define the SQL statement at runtime.
 java.lang.String dbURL
          Xmv annotated variable that allows you to change the database at runtime.
 
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
CombineBird()
           
 
Method Summary
 void digest()
          Overrides the StdBird digest method just to skip the time delay in StdBird.digest() whose goal is to simulate actual work being done
 void eatFood()
          Every Bird must eat food to stay alive and this method provides the instructions to eat from a database.
 java.lang.String getAuxFood()
          Two foods are eaten by this bird so two progress bars need to be updated to show its true progress.
 void setAuxFood(java.lang.String dbAuxFood)
          Copies the value in the auxiliary food name field displayed in the Aviary and writes it to the dbAuxFood variable.
 void setDbDriver(java.lang.String dbOther)
          Copies the value in the database driver name field displayed in the Aviary and writes it to the dbDriver variable.
 void setDbLogin(java.lang.String dbLogin)
          Copies the value in the db login field displayed in the Aviary and writes it to the dbLogin variable.
 void setDbName(java.lang.String dbResult)
          Copies the value in the database name field displayed in the Aviary and writes it to the dbName variable.
 void setDbPW(java.lang.String dbPW)
          Copies the value in the db password field displayed in the Aviary and writes it to the dbPW variable.
 void setDbSQLStatement(java.lang.String dbSQLStatement)
          Copies the value in the SQL Statement field displayed in the Aviary and writes it to the dbStatement variable.
 void setDbURL(java.lang.String dbURL)
          Copies the value in the database URL field displayed in the Aviary and writes it to the dbURL variable.
 void storeFood()
          Puts the digested food out for other Birds to eat.
 
Methods inherited from class com.avian.birds.basebirds.StdBird
checkAge, done, setHealthRef, setHealthStatus, setHistoryAreaRef, setJlRefLastAte, setStartButtonRef, setStartButtonText, setTupleTree
 
Methods inherited from class com.avian.birds.basebirds.AbstractBasicBird
addToBirdHistory, doInBackground, 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
 

Field Detail

dbURL

public java.lang.String dbURL
Xmv annotated variable that allows you to change the database at runtime. Requires a matching setter method.


dbLogin

public java.lang.String dbLogin
Xmv annotated variable that allows you to select the login name at runtime. Requires a matching setter method.


dbPW

public java.lang.String dbPW
Xmv annotated variable that allows you to select the password at runtime. Requires a matching setter method.


dbSQLStatement

public java.lang.String dbSQLStatement
Xmv annotated variable that allows you to define the SQL statement at runtime. Requires a matching setter method.


dbName

public java.lang.String dbName
Xmv annotated variable that allows you to select the database at runtime. Requires a matching setter method.


dbDriver

public java.lang.String dbDriver
Xmv annotated variable that allows you to select the database driver at runtime. Requires a matching setter method.


auxFood

public java.lang.String auxFood
Xmv annotated variable that allows you to set the name of the second food that this bird eats. Most birds eat only a single kind of food, but some will eat a second food. Requires a matching setter method.

Constructor Detail

CombineBird

public CombineBird()
Method Detail

setDbURL

public void setDbURL(java.lang.String dbURL)
Copies the value in the database URL field displayed in the Aviary and writes it to the dbURL variable. Requires a matching Xmv annotated variable.

Parameters:
dbURL - is the String value that is entered into this field in Aviary.

setDbLogin

public void setDbLogin(java.lang.String dbLogin)
Copies the value in the db login field displayed in the Aviary and writes it to the dbLogin variable. Requires a matching Xmv annotated variable.

Parameters:
dbLogin - is the String value that is entered into this field in Aviary.

setDbPW

public void setDbPW(java.lang.String dbPW)
Copies the value in the db password field displayed in the Aviary and writes it to the dbPW variable. Requires a matching Xmv annotated variable.

Parameters:
dbPW - is the String value that is entered into this field in Aviary.

setDbSQLStatement

public void setDbSQLStatement(java.lang.String dbSQLStatement)
Copies the value in the SQL Statement field displayed in the Aviary and writes it to the dbStatement variable. Requires a matching Xmv annotated variable.

Parameters:
dbSQLStatement - is the String value that is entered into this field in Aviary.

setDbName

public void setDbName(java.lang.String dbResult)
Copies the value in the database name field displayed in the Aviary and writes it to the dbName variable. Requires a matching Xmv annotated variable.

Parameters:
dbResult - is the String value that is entered into this field in Aviary.

setDbDriver

public void setDbDriver(java.lang.String dbOther)
Copies the value in the database driver name field displayed in the Aviary and writes it to the dbDriver variable. Requires a matching Xmv annotated variable.

Parameters:
dbOther - is the String value that is entered into this field in Aviary.

setAuxFood

public void setAuxFood(java.lang.String dbAuxFood)
Copies the value in the auxiliary food name field displayed in the Aviary and writes it to the dbAuxFood variable. Requires a matching Xmv annotated variable.

Parameters:
dbAuxFood - is the String value that is entered into this field in Aviary.

getAuxFood

public java.lang.String getAuxFood()
Two foods are eaten by this bird so two progress bars need to be updated to show its true progress. This method overrides the one in AbstractBasicBird that just returns a null String. This basic behavior allows the Aviary to always be able to check for AuxFood even if the bird doesn't implement AuxFood.

Overrides:
getAuxFood in class AbstractBasicBird
Returns:
name of the auxFood to use with jProgressBar

eatFood

public void eatFood()
Every Bird must eat food to stay alive and this method provides the instructions to eat from a database.

Overrides:
eatFood in class StdBird

digest

public void digest()
Overrides the StdBird digest method just to skip the time delay in StdBird.digest() whose goal is to simulate actual work being done

Overrides:
digest in class StdBird

storeFood

public void storeFood()
Puts the digested food out for other Birds to eat. The name for the digested food comes from the storeFood variable, which is the "key" that will be used to store the work packet (object). This object is the "value" in a pair. The next Birds will eat (get) this food using the name used here.

Overrides:
storeFood in class StdBird