|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectdarwin.domain.MySpecies
The individual creatures in the world are all representatives of some species class and share certain common characteristics, such as the species name and the program they execute. Rather than copy this information into each creature, this data can be recorded once as part of the description for a species and then each creature can simply include the appropriate species reference as part of its internal data structure.
To encapsulate all of the operations operating on a Species within this abstraction, this provides a constructor that will read a file containing the name of the Species and its Program, as described in the assignment. Note: The instruction addresses start at one, not zero.
Constructor Summary | |
MySpecies(java.lang.String aFileName)
Create a Species from a file. |
|
MySpecies(java.lang.String aName,
java.lang.String aColor,
Program aProgram)
Create a Species with a given name, color and program. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface darwin.domain.Species |
getColor, getName, getProgramSize, getProgramStep |
Constructor Detail |
public MySpecies(java.lang.String aFileName) throws java.io.IOException
aFileName
- the name of the Species file.
java.io.IOException
- if there is an I/O error.public MySpecies(java.lang.String aName, java.lang.String aColor, Program aProgram)
aName
- the name of the species.aColor
- the color of the species.aProgram
- the program of the species.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |