diff options
| author | Sam Anthony <sam@samanthony.xyz> | 2024-11-28 10:42:31 -0500 |
|---|---|---|
| committer | Sam Anthony <sam@samanthony.xyz> | 2024-11-28 10:42:31 -0500 |
| commit | 6a710c3943f2350f4575f8cb1898129ef3c7dfdd (patch) | |
| tree | dc20bc0480e77a74f2176e5f0fed02ad2251a2cd /src/main/java/derms/replica/replica1/City.java | |
| parent | 0cae203edc71b0285d2971f9124f24cb543b8e39 (diff) | |
| download | soen423-6a710c3943f2350f4575f8cb1898129ef3c7dfdd.zip | |
rename assignment code replica package
Diffstat (limited to 'src/main/java/derms/replica/replica1/City.java')
| -rw-r--r-- | src/main/java/derms/replica/replica1/City.java | 38 |
1 files changed, 0 insertions, 38 deletions
diff --git a/src/main/java/derms/replica/replica1/City.java b/src/main/java/derms/replica/replica1/City.java deleted file mode 100644 index 548f1fa..0000000 --- a/src/main/java/derms/replica/replica1/City.java +++ /dev/null @@ -1,38 +0,0 @@ -package derms.replica.replica1; - -import java.io.Serializable; - -public class City implements Serializable { - public static final int codeLen = 3; - - private String code; - - public City(String code) throws IllegalArgumentException { - if (code.length() != codeLen) - throw new IllegalArgumentException("Invalid city: "+code+"; must be "+codeLen+" letters"); - this.code = code; - } - - public City() { - this("XXX"); - } - - @Override - public String toString() { - return code; - } - - @Override - public boolean equals(Object obj) { - if (obj == null || this.getClass() != obj.getClass()) { - return false; - } - City other = (City) obj; - return this.code.equals(other.code); - } - - @Override - public int hashCode() { - return code.hashCode(); - } -} |