cs2110.assignment1
Class Species

java.lang.Object
  extended by cs2110.assignment1.Species

public abstract class Species
extends java.lang.Object

The Species class represents a species record read from a data file. Species records contain four attributes: Name, LatinName, ImageFilename, and DNA. They make use of a DNAParser to extract genes from DNA.

Author:
CS2110 Course Staff

Constructor Summary
Species()
           
 
Method Summary
abstract  java.lang.String getDNA()
          Get the Species' DNA
abstract  java.util.Collection<Gene> getGenome()
          Get the Species' genome.
abstract  java.lang.String getImageFilename()
          Get the filename pointing to the Species' image
abstract  java.lang.String getLatinName()
          Get the Species' scientific name
abstract  java.lang.String getName()
          Get the Species' common name
abstract  void setDNA(java.lang.String DNA)
          Set the Species' DNA Note: For our purposes, a Species will only ever have its DNA set once.
abstract  void setImageFilename(java.lang.String imageFilename)
          Set the filename pointing to the Species' image
abstract  void setLatinName(java.lang.String latinName)
          Set the Species' scientific name
abstract  void setName(java.lang.String name)
          Set the Species' common name
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Species

public Species()
Method Detail

setName

public abstract void setName(java.lang.String name)
Set the Species' common name

Parameters:
name -

getName

public abstract java.lang.String getName()
Get the Species' common name


setLatinName

public abstract void setLatinName(java.lang.String latinName)
Set the Species' scientific name

Parameters:
latinName -

getLatinName

public abstract java.lang.String getLatinName()
Get the Species' scientific name

Returns:

setDNA

public abstract void setDNA(java.lang.String DNA)
Set the Species' DNA Note: For our purposes, a Species will only ever have its DNA set once.

Parameters:
DNA -

getDNA

public abstract java.lang.String getDNA()
Get the Species' DNA

Returns:

setImageFilename

public abstract void setImageFilename(java.lang.String imageFilename)
Set the filename pointing to the Species' image

Parameters:
imageFilename -

getImageFilename

public abstract java.lang.String getImageFilename()
Get the filename pointing to the Species' image

Returns:

getGenome

public abstract java.util.Collection<Gene> getGenome()
Get the Species' genome. A genome is the set of genes parsed from raw DNA. The return value of getGenome SHOULD NOT contain duplicate genes, even if genes are duplicated in the DNA string. You can parse the genome when setDNA is called ("eager"), or when getGenome is called ("lazy"). If the latter, avoid parsing the genome every time getGenome is called.

Returns:
A duplicate-free set of genes found in this Species' DNA