-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathWolf.java
45 lines (39 loc) · 916 Bytes
/
Wolf.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/*
* Created by Noah Shaw
*/
public class Wolf extends Dog {
//Attributes
private String packLeaderName;
//Constructors
public Wolf() //Default
{
super();
this.packLeaderName = "Alpha";
}
public Wolf(String aName, double aWeight, int aEnergyLevel, String aPackLeaderName) //Parameter
{
super(aName, aWeight, aEnergyLevel);
this.setPackLeaderName(aPackLeaderName);
}
//Accessors
public String getPackLeaderName()
{
return this.packLeaderName;
}
//Mutators
public void setPackLeaderName(String aPackLeaderName)
{
this.packLeaderName = aPackLeaderName;
}
//Methods
public String toString()
{
return super.toString()+" Pack Leader Name: "+this.packLeaderName;
}
public boolean equals(Wolf aWolf)
{
return aWolf != null &&
super.equals(aWolf) &&
this.packLeaderName.equalsIgnoreCase(aWolf.getPackLeaderName());
}
}