package abstractFactory.rusFleet;
import abstractFactory.Car;
import abstractFactory.Truck;
public class Kamaz
extends Truck
implements Cloneable { private int series;
public Kamaz
(String number,
int series,
int wheelNum, boolean trailer) {
super(number, 2, wheelNum, 3, 150, 11000, trailer);
this.series = series;
}
public int getSeries() {
return series;
}
//equals/hashCode/toString >>
public boolean equals
(Object o
) { if (!(o instanceof Car)) {
return false;
}
if (!(o instanceof Kamaz)) {
return o.equals(this);
}
Kamaz other = (Kamaz) o;
return (super.equals(o) &&
other.series == series);
}
public int hashCode() {
int res = super.hashCode();
res = res * 37 + series;
return res;
}
String res =
super.
toString();
res += ", series=" + series;
return res;
}
}