|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.avian.foods.basefoods.DefaultFood
public class DefaultFood
DefaultFood implements the Manna interface, providing simple instances of each required method. The process method simply does a little housekeeping, counts to 1 million, does a little more housekeeping, and then completes. Real foods types will have to implement more sophisticated process methods.
Field Summary | |
---|---|
protected java.lang.String |
contents
The thing that gets worked on by all the different birds. |
protected java.lang.String |
description
Description of this food |
protected java.lang.String |
mannaHistory
History of this food and who ate it |
protected MilliTimeString |
mts
A helper object that hides the details of formatting millisecond time Strings. |
protected java.lang.String |
name
Name of this food |
Constructor Summary | |
---|---|
DefaultFood()
Default constructor for DefaultFood objects. |
|
DefaultFood(java.lang.String food)
Other constructor for DefaultFood objects. |
|
DefaultFood(java.lang.String historyMsg,
boolean magicallyAdded)
Another constructor for DefaultFood objects. |
Method Summary | |
---|---|
java.lang.String |
getDescription()
Gets the description of this food object. |
java.lang.String |
getName()
Gets the name of this food object. |
void |
setDescription(java.lang.String description)
Sets the description of this food object. |
void |
setName(java.lang.String newName)
Sets the name of this food object to newName. |
java.lang.String |
toHistoryString()
Gets the history of this individual food chunk. |
java.lang.String |
toHistoryStringShort()
Gets a short chunk of text that describes the last event or several events that happened to this food object. |
java.lang.String |
toString()
Gets a String that represents the contents of this food object |
java.lang.String |
toStringShort()
Gets a chunk of text not to exceed 70 characters in length. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected java.lang.String name
protected java.lang.String description
protected java.lang.String mannaHistory
protected java.lang.String contents
protected MilliTimeString mts
Constructor Detail |
---|
public DefaultFood()
public DefaultFood(java.lang.String food)
food
- is the line that was read from a file as a Stringpublic DefaultFood(java.lang.String historyMsg, boolean magicallyAdded)
historyMsg
- is the event description to add to the food's historymagicallyAdded
- is true if the food should be magically created.Method Detail |
---|
public java.lang.String toHistoryString()
public java.lang.String toHistoryStringShort()
public java.lang.String toStringShort()
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String getName()
getName
in interface Manna
public void setName(java.lang.String newName)
setName
in interface Manna
newName
- String value that will become the new name for this food object.public java.lang.String getDescription()
getDescription
in interface Manna
public void setDescription(java.lang.String description)
setDescription
in interface Manna
description
- String that describes this food object.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |