1 7 8 9 package javax.print.attribute; 10 11 import java.io.Serializable ; 12 13 import java.util.Date ; 14 15 43 public abstract class DateTimeSyntax implements Serializable , Cloneable { 44 45 private static final long serialVersionUID = -1400819079791208582L; 46 47 49 53 private Date value; 54 55 57 66 protected DateTimeSyntax(Date value) { 67 if (value == null) { 68 throw new NullPointerException ("value is null"); 69 } 70 this.value = value; 71 } 72 73 75 80 public Date getValue() { 81 return new Date (value.getTime()); 82 } 83 84 86 104 public boolean equals(Object object) { 105 return (object != null && 106 object instanceof DateTimeSyntax && 107 value.equals(((DateTimeSyntax ) object).value)); 108 } 109 110 114 public int hashCode() { 115 return value.hashCode(); 116 } 117 118 124 public String toString() { 125 return "" + value; 126 } 127 128 } 129 | Popular Tags |