FileDocCategorySizeDatePackage
Animal.javaAPI DocExample1306Sat Apr 23 22:35:42 BST 2005None

Animal

public class Animal extends SimpleElement

Fields Summary
public static final int
MAMMAL
int
animalClass
String
name
String
species
String
habitat
String
food
String
temperament
FoodRecipe
foodRecipe
Constructors Summary
Methods Summary
public intgetAnimalClass()

 return animalClass; 
public java.lang.StringgetFood()

 return food; 
public FoodRecipegetFoodRecipe()

 return foodRecipe; 
public java.lang.StringgetHabitat()

 return habitat; 
public java.lang.StringgetName()

 return name; 
public java.lang.StringgetSpecies()

 return species; 
public java.lang.StringgetTemperament()

 return temperament; 
public voidsetAnimalClass(int animalClass)

 
		this.animalClass = animalClass; 
public voidsetAttributeValue(java.lang.String name, java.lang.String value)

 
		if ( name.equals("class") && value.equals("mammal") )
			setAnimalClass( MAMMAL );
		else
			throw new Error("No such attribute: "+name);
	
public voidsetFood(java.lang.String food)

 this.food = food ; 
public voidsetFoodRecipe(FoodRecipe recipe)

 this.foodRecipe = recipe; 
public voidsetHabitat(java.lang.String habitat)

 this.habitat = habitat ; 
public voidsetName(java.lang.String name)


	       this.name = name ; 
public voidsetSpecies(java.lang.String species)

 this.species = species ; 
public voidsetTemperament(java.lang.String temperament)

 
		this.temperament = temperament ; 
public java.lang.StringtoString()

 return name +"("+species+")";