/home/caleb/ASDV-Java/Semester 2/Assignments/MP4_CalebFontenot/src/main/java/com/calebfontenot/mp4_calebfontenot/ChildBike.java |
package com.calebfontenot.mp4_calebfontenot;
@author
public class ChildBike extends Bicycle
{
@Override
public boolean equals(Object obj)
{
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final ChildBike other = (ChildBike) obj;
System.out.println("Super returns: " + super.equals(obj));
return this.helpWheels == other.helpWheels && super.equals(obj);
}
private boolean helpWheels;
public ChildBike(boolean helpWheels, int cadence, int gear, int speed)
{
super(cadence, gear, speed);
this.helpWheels = helpWheels;
}
public boolean isHelpWheels()
{
return helpWheels;
}
public void setHelpWheels(boolean helpWheels)
{
this.helpWheels = helpWheels;
}
@Override
Details calculatedDetails()
{
return Details.getDetails(this);
}
@Override
public String toString()
{
return super.toString() + "ChildBike{" + "helpWheels=" + helpWheels + '}';
}
}