| 6 | package patterns.trash; |
| 7 | |
| 8 | public abstract class Trash { |
| 9 | public final double weight; |
| 10 | public Trash(double weight) { |
| 11 | this.weight = weight; |
| 12 | } |
| 13 | public abstract double price(); |
| 14 | @Override public String toString() { |
| 15 | return String.format( |
| 16 | "%s weight: %.2f * price: %.2f = %.2f", |
| 17 | getClass().getSimpleName(), |
| 18 | weight, price(), weight * price()); |
| 19 | } |
| 20 | // Ignore for now; to be used later: |
| 21 | public abstract void accept(Visitor v); |
| 22 | } |
nothing calls this directly
no outgoing calls
no test coverage detected