From: <mu...@us...> - 2007-11-21 16:49:48
|
Revision: 615 http://jfreechart.svn.sourceforge.net/jfreechart/?rev=615&view=rev Author: mungady Date: 2007-11-21 08:49:45 -0800 (Wed, 21 Nov 2007) Log Message: ----------- 2007-11-21 David Gilbert <dav...@ob...> * source/org/jfree/chart/plot/DatasetRenderingOrder.java (hashCode): Implemented, * source/org/jfree/chart/plot/DialShape.java (hashCode): Likewise, * source/org/jfree/chart/plot/PlotOrientation.java (hashCode): Likewise, * source/org/jfree/chart/plot/SeriesRenderingOrder.java (hashCode): Likewise. Modified Paths: -------------- branches/jfreechart-1.0.x-branch/ChangeLog branches/jfreechart-1.0.x-branch/source/org/jfree/chart/plot/DatasetRenderingOrder.java branches/jfreechart-1.0.x-branch/source/org/jfree/chart/plot/DialShape.java branches/jfreechart-1.0.x-branch/source/org/jfree/chart/plot/PlotOrientation.java branches/jfreechart-1.0.x-branch/source/org/jfree/chart/plot/SeriesRenderingOrder.java Modified: branches/jfreechart-1.0.x-branch/ChangeLog =================================================================== --- branches/jfreechart-1.0.x-branch/ChangeLog 2007-11-21 16:24:47 UTC (rev 614) +++ branches/jfreechart-1.0.x-branch/ChangeLog 2007-11-21 16:49:45 UTC (rev 615) @@ -1,5 +1,16 @@ 2007-11-21 David Gilbert <dav...@ob...> + * source/org/jfree/chart/plot/DatasetRenderingOrder.java + (hashCode): Implemented, + * source/org/jfree/chart/plot/DialShape.java + (hashCode): Likewise, + * source/org/jfree/chart/plot/PlotOrientation.java + (hashCode): Likewise, + * source/org/jfree/chart/plot/SeriesRenderingOrder.java + (hashCode): Likewise. + +2007-11-21 David Gilbert <dav...@ob...> + * source/org/jfree/chart/axis/DateAxis.java (previousStandardDate): Return dates already fetched. Modified: branches/jfreechart-1.0.x-branch/source/org/jfree/chart/plot/DatasetRenderingOrder.java =================================================================== --- branches/jfreechart-1.0.x-branch/source/org/jfree/chart/plot/DatasetRenderingOrder.java 2007-11-21 16:24:47 UTC (rev 614) +++ branches/jfreechart-1.0.x-branch/source/org/jfree/chart/plot/DatasetRenderingOrder.java 2007-11-21 16:49:45 UTC (rev 615) @@ -36,6 +36,7 @@ * -------- * 02-May-2003 : Version 1 (DG); * 02-Jun-2004 : Changed 'STANDARD' --> 'FORWARD' (DG); + * 21-Nov-2007 : Implemented hashCode() (DG); * */ @@ -59,14 +60,14 @@ * of datasets. */ public static final DatasetRenderingOrder FORWARD - = new DatasetRenderingOrder("DatasetRenderingOrder.FORWARD"); + = new DatasetRenderingOrder("DatasetRenderingOrder.FORWARD"); /** * Render datasets in the order N-1, N-2, ..., 2, 1, 0, where N is the * number of datasets. */ public static final DatasetRenderingOrder REVERSE - = new DatasetRenderingOrder("DatasetRenderingOrder.REVERSE"); + = new DatasetRenderingOrder("DatasetRenderingOrder.REVERSE"); /** The name. */ private String name; @@ -93,29 +94,34 @@ * Returns <code>true</code> if this object is equal to the specified * object, and <code>false</code> otherwise. * - * @param o the other object. + * @param obj the object (<code>null</code> permitted). * * @return A boolean. */ - public boolean equals(Object o) { - - if (this == o) { + public boolean equals(Object obj) { + if (this == obj) { return true; } - if (!(o instanceof DatasetRenderingOrder)) { + if (!(obj instanceof DatasetRenderingOrder)) { return false; } - - DatasetRenderingOrder order = (DatasetRenderingOrder) o; + DatasetRenderingOrder order = (DatasetRenderingOrder) obj; if (!this.name.equals(order.toString())) { return false; } - return true; - } /** + * Returns a hash code for this instance. + * + * @return A hash code. + */ + public int hashCode() { + return this.name.hashCode(); + } + + /** * Ensures that serialization returns the unique instances. * * @return The object. Modified: branches/jfreechart-1.0.x-branch/source/org/jfree/chart/plot/DialShape.java =================================================================== --- branches/jfreechart-1.0.x-branch/source/org/jfree/chart/plot/DialShape.java 2007-11-21 16:24:47 UTC (rev 614) +++ branches/jfreechart-1.0.x-branch/source/org/jfree/chart/plot/DialShape.java 2007-11-21 16:49:45 UTC (rev 615) @@ -35,6 +35,7 @@ * Changes: * -------- * 20-Aug-2003 : Version 1 (DG); + * 12-Nov-2007 : Implemented hashCode() (DG); * */ @@ -105,6 +106,15 @@ } /** + * Returns a hash code for this instance. + * + * @return A hash code. + */ + public int hashCode() { + return this.name.hashCode(); + } + + /** * Ensures that serialization returns the unique instances. * * @return The object. Modified: branches/jfreechart-1.0.x-branch/source/org/jfree/chart/plot/PlotOrientation.java =================================================================== --- branches/jfreechart-1.0.x-branch/source/org/jfree/chart/plot/PlotOrientation.java 2007-11-21 16:24:47 UTC (rev 614) +++ branches/jfreechart-1.0.x-branch/source/org/jfree/chart/plot/PlotOrientation.java 2007-11-21 16:49:45 UTC (rev 615) @@ -36,6 +36,7 @@ * -------- * 02-May-2003 : Version 1 (DG); * 17-Jul-2003 : Added readResolve() method (DG); + * 21-Nov-2007 : Implemented hashCode() (DG); * */ @@ -54,11 +55,11 @@ /** For a plot where the range axis is horizontal. */ public static final PlotOrientation HORIZONTAL - = new PlotOrientation("PlotOrientation.HORIZONTAL"); + = new PlotOrientation("PlotOrientation.HORIZONTAL"); /** For a plot where the range axis is vertical. */ public static final PlotOrientation VERTICAL - = new PlotOrientation("PlotOrientation.VERTICAL"); + = new PlotOrientation("PlotOrientation.VERTICAL"); /** The name. */ private String name; @@ -85,29 +86,34 @@ * Returns <code>true</code> if this object is equal to the specified * object, and <code>false</code> otherwise. * - * @param o the other object. + * @param obj the object (<code>null</code> permitted). * * @return A boolean. */ - public boolean equals(Object o) { - - if (this == o) { + public boolean equals(Object obj) { + if (this == obj) { return true; } - if (!(o instanceof PlotOrientation)) { + if (!(obj instanceof PlotOrientation)) { return false; } - - PlotOrientation orientation = (PlotOrientation) o; + PlotOrientation orientation = (PlotOrientation) obj; if (!this.name.equals(orientation.toString())) { return false; } - return true; - } /** + * Returns a hash code for this instance. + * + * @return A hash code. + */ + public int hashCode() { + return this.name.hashCode(); + } + + /** * Ensures that serialization returns the unique instances. * * @return The object. Modified: branches/jfreechart-1.0.x-branch/source/org/jfree/chart/plot/SeriesRenderingOrder.java =================================================================== --- branches/jfreechart-1.0.x-branch/source/org/jfree/chart/plot/SeriesRenderingOrder.java 2007-11-21 16:24:47 UTC (rev 614) +++ branches/jfreechart-1.0.x-branch/source/org/jfree/chart/plot/SeriesRenderingOrder.java 2007-11-21 16:49:45 UTC (rev 615) @@ -2,7 +2,7 @@ * JFreeChart : a free chart library for the Java(tm) platform * =========================================================== * - * (C) Copyright 2000-2005, by Object Refinery Limited and Contributors. + * (C) Copyright 2000-2007, by Object Refinery Limited and Contributors. * * Project Info: http://www.jfree.org/jfreechart/index.html * @@ -27,14 +27,15 @@ * -------------------------- * SeriesRenderingOrder.java * -------------------------- - * (C) Copyright 2005, by Object Refinery Limited. + * (C) Copyright 2005, 2007, by Object Refinery Limited. * * Original Author: Eric Thomas (www.isti.com); - * Contributor(s): -; + * Contributor(s): David Gilbert (for Object Refinery Limited); * * Changes: * -------- * 21-Apr-2005 : Version 1 contributed by Eric Thomas (ET); + * 21-Nov-2007 : Implemented hashCode() (DG); * */ @@ -57,14 +58,14 @@ * of series. */ public static final SeriesRenderingOrder FORWARD - = new SeriesRenderingOrder("SeriesRenderingOrder.FORWARD"); + = new SeriesRenderingOrder("SeriesRenderingOrder.FORWARD"); /** * Render series in the order N-1, N-2, ..., 2, 1, 0, where N is the * number of series. */ public static final SeriesRenderingOrder REVERSE - = new SeriesRenderingOrder("SeriesRenderingOrder.REVERSE"); + = new SeriesRenderingOrder("SeriesRenderingOrder.REVERSE"); /** The name. */ private String name; @@ -91,29 +92,34 @@ * Returns <code>true</code> if this object is equal to the specified * object, and <code>false</code> otherwise. * - * @param obj the other object. + * @param obj the object (<code>null</code> permitted). * * @return A boolean. */ public boolean equals(Object obj) { - if (this == obj) { return true; } if (!(obj instanceof SeriesRenderingOrder)) { return false; } - SeriesRenderingOrder order = (SeriesRenderingOrder) obj; if (!this.name.equals(order.toString())) { return false; } - return true; - } /** + * Returns a hash code for this instance. + * + * @return A hash code. + */ + public int hashCode() { + return this.name.hashCode(); + } + + /** * Ensures that serialization returns the unique instances. * * @return The object. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |