1 42 43 package org.jfree.chart.axis; 44 45 import java.util.Date ; 46 47 import org.jfree.ui.TextAnchor; 48 import org.jfree.util.ObjectUtilities; 49 50 53 public class DateTick extends ValueTick { 54 55 56 private Date date; 57 58 68 public DateTick(Date date, String label, 69 TextAnchor textAnchor, TextAnchor rotationAnchor, 70 double angle) { 71 72 super(date.getTime(), label, textAnchor, rotationAnchor, angle); 73 this.date = date; 74 75 } 76 77 82 public Date getDate() { 83 return this.date; 84 } 85 86 93 public boolean equals(Object obj) { 94 if (obj == this) { 95 return true; 96 } 97 if (obj instanceof DateTick && super.equals(obj)) { 98 DateTick dt = (DateTick) obj; 99 if (!ObjectUtilities.equal(this.date, dt.date)) { 100 return false; 101 } 102 return true; 103 } 104 return false; 105 } 106 107 112 public int hashCode() { 113 return this.date.hashCode(); 114 } 115 116 } 117 | Popular Tags |