/**** * * @author gtowell * file: Rabbit.java * Desc: * A tiny little class that holds information about an individual rabbit */ public class Rabbit { /** * The breed name, eg lop */ private String breed; /** * The rabbit's birth date, as a double. */ private double birthdate; /** * The id of the rabbit. This is on a tag affixed to each rabbits ear. */ private String iD; /** * Rabbit constructor * @param breed the name of the breed * @param bday the birth date * @param id the ear tag id */ public Rabbit(String breed, double bday, String id) { this.breed=breed; this.birthdate=bday; this.iD=id; } /** * Gives information about the rabbit * @return a string describing the rabbit */ @Override public String toString() { return String.format("%s %s %10.4f", breed, iD, birthdate); } /** * get accessor for the Id of teh rabbit * @return the id of the rabbit */ public String getId() { return iD; } }