/**
 * Base class of a gerarchy of animals
 * provides method for getting and setting a name and a color
 * the class is abstract because the number of legs and the species name
 * cannot be given for a generic Animal
 */

public abstract class Animal {

    /**
     * constructs an animal with given name and color
     */
    public Animal(String theName, String theColor) {
	name = theName;
	color = theColor;
    }

    /**
     * returns the number of legs of the animal.
     * The method is abstract, this means that it has no implementation
     * hence every subclass must define its own implementation
     */
    abstract public int getNLegs();

    public String getColor() {
	return color;
    } 

    public void setColor(String newColor) {
	color = newColor;
    }

    public String getName() {
	return name;
    }

    public void setName(String newName) {
	name = newName;
    }

    /** 
     * returns the name of the species.
     */
    public abstract String getSpeciesName();

    // private data
    private String color;
    private String name;
}
