diff options
| author | mokha <mokha@cisco.com> | 2019-05-05 19:36:09 -0600 |
|---|---|---|
| committer | mokha <mokha@cisco.com> | 2019-05-05 19:36:09 -0600 |
| commit | 3c2be35d16d7482442911f5b06b68512f86e15b5 (patch) | |
| tree | 636edf7d09f2cc0b2f006c058071ce5b3d9adda6 /src/main/java/ca/mokhan/assignment1/Communication.java | |
| parent | 46e409f3ca33ec3c7546d0589301c2a4f967c10a (diff) | |
butcher default directory structure to make instructor happy
Diffstat (limited to 'src/main/java/ca/mokhan/assignment1/Communication.java')
| -rw-r--r-- | src/main/java/ca/mokhan/assignment1/Communication.java | 40 |
1 files changed, 0 insertions, 40 deletions
diff --git a/src/main/java/ca/mokhan/assignment1/Communication.java b/src/main/java/ca/mokhan/assignment1/Communication.java deleted file mode 100644 index 2e4c2a8..0000000 --- a/src/main/java/ca/mokhan/assignment1/Communication.java +++ /dev/null @@ -1,40 +0,0 @@ -package ca.mokhan.assignment1; - -public class Communication implements Comparable<Communication> { - private String name; - private Integer ranking; - - public Communication(String name, Integer ranking) { - this.name = name; - this.ranking = ranking; - } - - public int compareTo(Communication other) { - return this.ranking.compareTo(other.ranking); - } - - public boolean isAtLeast(Communication other) { - return this.compareTo(other) >= 0; - } - - @Override - public String toString() { - return this.name; - } - - public static final Communication Poor = new Communication("poor", 0); - public static final Communication Average = new Communication("average", 1); - public static final Communication Excellent = new Communication("excellent", 2); - - public static Communication findBy(String name) { - switch (name) { - case "poor": - return Communication.Poor; - case "average": - return Communication.Average; - case "excellent": - return Communication.Excellent; - } - throw new IllegalArgumentException("Unknown communication type"); - } -} |
