diff options
| author | Sam Anthony <sam@samanthony.xyz> | 2024-12-02 19:03:09 -0500 |
|---|---|---|
| committer | Sam Anthony <sam@samanthony.xyz> | 2024-12-02 19:03:09 -0500 |
| commit | cb479767593be781b3295ca67979d6be375153e3 (patch) | |
| tree | dc5101e0e4e5411540645f63613e5cc17c5eecf6 /src/main/java/derms/replica3/City.java | |
| parent | b9a3af628b1a6fd5903324b578940f25b2613032 (diff) | |
| download | soen423-cb479767593be781b3295ca67979d6be375153e3.zip | |
combine replica2.City and replica3.City
Diffstat (limited to 'src/main/java/derms/replica3/City.java')
| -rw-r--r-- | src/main/java/derms/replica3/City.java | 40 |
1 files changed, 0 insertions, 40 deletions
diff --git a/src/main/java/derms/replica3/City.java b/src/main/java/derms/replica3/City.java deleted file mode 100644 index 89fd8ce..0000000 --- a/src/main/java/derms/replica3/City.java +++ /dev/null @@ -1,40 +0,0 @@ -package derms.replica3; - -import java.io.Serializable; - -public class City implements Serializable { - static final int codeLen = 3; - - private String code; - - 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"); - } - public String getCode(){ - return code; - } - @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(); - } -} |