Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package model;
- import java.util.Objects;
- public class Resistor extends HardwareComponent { //Eldira Sesto, 11815163
- private float resistorValue;
- public Resistor(String id, float price, float resistorValue) {
- super(id, price);
- this.resistorValue = resistorValue;
- }
- public float getResistorValue() {
- return resistorValue;
- }
- public void setResistorValue(float resistorValue) {
- this.resistorValue = resistorValue;
- }
- @Override
- public boolean equals(Object o) {
- if (this == o) return true;
- if (o == null || getClass() != o.getClass()) return false;
- if (!super.equals(o)) return false;
- Resistor resistor = (Resistor) o;
- return Float.compare(resistor.getResistorValue(), getResistorValue()) == 0;
- }
- @Override
- public String toString() {
- return "Resistor " + super.toString() + "<" + getResistorValue() + ">";
- }
- }
Add Comment
Please, Sign In to add comment