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