MCPcopy Create free account
hub / github.com/BruceEckel/OnJava8-Examples / Paper

Class Paper

enums/Paper.java:8–21  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6import static enums.Outcome.*;
7
8public class Paper implements Item {
9 @Override public Outcome compete(Item it) {
10 return it.eval(this);
11 }
12 @Override
13 public Outcome eval(Paper p) { return DRAW; }
14 @Override
15 public Outcome eval(Scissors s) { return WIN; }
16 @Override
17 public Outcome eval(Rock r) { return LOSE; }
18 @Override public String toString() {
19 return "Paper";
20 }
21}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected