Public Member Functions | |
Modification () | |
Default constructor. | |
Date | getTimestamp () |
Get modification timestamp. | |
Modification | setTimestamp (Date timestamp) |
Set modification timestamp. | |
String | getModifier () |
Get the name of the person who made this modification. | |
Modification | setModifier (String modifier) |
Set the name of the person who made this modification. | |
String | getComment () |
Get the modification comment (may be null). | |
Modification | setComment (String comment) |
Set the modification comment (may be null). | |
Modification | unsetComment () |
Unset the modification comment. | |
int | compareTo (Modification other) |
String | toString () |
Default String representation: declares that method is not properly defined by default. | |
boolean | equals (Object other) |
int | hashCode () |
Package Functions | |
Logger | log () |
Neat method to allow every class to get hold of a custom-named Logger. |
Definition at line 10 of file Modification.java.
Modification | ( | ) |
Date getTimestamp | ( | ) |
Get modification timestamp.
Definition at line 37 of file Modification.java.
Referenced by Modification.compareTo(), Modification.hashCode(), and Modification.toString().
Modification setTimestamp | ( | Date | timestamp | ) |
String getModifier | ( | ) |
Get the name of the person who made this modification.
Definition at line 48 of file Modification.java.
Referenced by Modification.hashCode(), and Modification.toString().
Modification setModifier | ( | String | modifier | ) |
Set the name of the person who made this modification.
Definition at line 52 of file Modification.java.
String getComment | ( | ) |
Get the modification comment (may be null).
Definition at line 59 of file Modification.java.
Referenced by Modification.hashCode(), and Modification.toString().
Modification setComment | ( | String | comment | ) |
Modification unsetComment | ( | ) |
int compareTo | ( | Modification | other | ) |
Definition at line 77 of file Modification.java.
References Modification.getTimestamp(), and Storeable.log().
00077 { 00078 log().debug("Comparing modifications..."); 00079 if (getTimestamp() == null) { 00080 log().warn("Null timestamp"); 00081 return 1; // Sort null at the end 00082 } else if (getTimestamp().after(other.getTimestamp())) { 00083 log().debug("Greater than"); 00084 return 1; 00085 } else if (getTimestamp().before(other.getTimestamp())) { 00086 log().debug("Less than"); 00087 return -1; 00088 } else { 00089 log().debug("Equal to"); 00090 return 0; 00091 } 00092 }
String toString | ( | ) |
Default String representation: declares that method is not properly defined by default.
Reimplemented from Storeable.
Definition at line 98 of file Modification.java.
References Modification.getComment(), Modification.getModifier(), and Modification.getTimestamp().
00098 { 00099 StringBuffer s = new StringBuffer(); 00100 s.append(getTimestamp().toString() + ", "); 00101 s.append(getModifier() + "\n"); 00102 s.append(getComment()); 00103 return s.toString(); 00104 }
boolean equals | ( | Object | other | ) |
Definition at line 107 of file Modification.java.
References Modification.hashCode().
00107 { 00108 if (this == other) return true; 00109 if (! (other instanceof Modification)) return false; 00110 return hashCode() == other.hashCode(); 00111 }
int hashCode | ( | ) |
Definition at line 114 of file Modification.java.
References Modification.getComment(), Modification.getModifier(), and Modification.getTimestamp().
Referenced by Modification.equals().
00114 { 00115 int code = 53; 00116 if (getTimestamp() != null) code ^= getTimestamp().hashCode(); 00117 if (getModifier() != null) code ^= getModifier().hashCode(); 00118 if (getComment() != null) code ^= getComment().hashCode(); 00119 return code; 00120 }
Logger log | ( | ) | [package, inherited] |
Neat method to allow every class to get hold of a custom-named Logger.
Definition at line 14 of file Storeable.java.
Referenced by Uncertainty.compareTo(), Reference.compareTo(), PointError.compareTo(), Modification.compareTo(), Experiment.compareTo(), DatasetError.compareTo(), AxisError.compareTo(), Data.makeExample(), Data.makeExampleDataset(), Data.makeExampleExperiment(), Data.makeExamplePaper(), Data.makeExampleXAxes(), Data.makeExampleYAxes(), AxisError.setAxis(), DatasetError.setDataset(), DatasetError.setNormType(), PointError.setPoint(), and Uncertainty.toString().