MCPcopy Index your code
hub / github.com/BruceEckel/OnJava8-Examples / Trash

Class Trash

patterns/trash/Trash.java:8–22  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6package patterns.trash;
7
8public 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}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected