OSDN Git Service

Commandのクラス名を変更
[coroid/inqubus.git] / frontend / src / yukihane / inqubus / model / Location.java
1 package yukihane.inqubus.model;
2
3 import java.io.File;
4
5 /**
6  *
7  * @author yuki
8  */
9 class Location {
10
11     private final String location;
12
13     public Location(String location) {
14         if (location == null) {
15             throw new IllegalArgumentException();
16         }
17         this.location = location;
18     }
19
20     Location(File f) {
21         this.location = f.getPath();
22     }
23
24     @Override
25     public String toString() {
26         return location;
27     }
28
29     @Override
30     public int hashCode() {
31         return location.hashCode();
32
33     }
34
35     @Override
36     public boolean equals(Object obj) {
37         if (obj == null) {
38             return false;
39         }
40         if (getClass() != obj.getClass()) {
41             return false;
42         }
43         final Location other = (Location) obj;
44         if ((this.location == null) ? (other.location != null) : !this.location.equals(other.location)) {
45             return false;
46         }
47         return true;
48     }
49 }