1 package polyglot.frontend; 2 3 import java.util.Date ; 4 5 6 public class Source 7 { 8 protected String name; 9 protected String path; 10 protected Date lastModified; 11 12 17 protected boolean userSpecified; 18 19 protected Source(String name) { 20 this(name, null, null, false); 21 } 22 23 protected Source(String name, boolean userSpecified) { 24 this(name, null, null, userSpecified); 25 } 26 27 public Source(String name, String path, Date lastModified) { 28 this(name, path, lastModified, false); 29 } 30 31 public Source(String name, String path, Date lastModified, boolean userSpecified) { 32 this.name = name; 33 this.path = path; 34 this.lastModified = lastModified; 35 this.userSpecified = userSpecified; 36 } 37 38 public boolean equals(Object o) { 39 if (o instanceof Source) { 40 Source s = (Source) o; 41 return name.equals(s.name) && path.equals(s.path); 42 } 43 44 return false; 45 } 46 47 public int hashCode() { 48 return path.hashCode() + name.hashCode(); 49 } 50 51 52 public String name() { 53 return name; 54 } 55 56 57 public String path() { 58 return path; 59 } 60 61 62 public Date lastModified() { 63 return lastModified; 64 } 65 66 public String toString() { 67 return path; 68 } 69 70 public void setUserSpecified(boolean userSpecified) { 71 this.userSpecified = userSpecified; 72 } 73 74 public boolean userSpecified() { 75 return userSpecified; 76 } 77 } 78 | Popular Tags |