您好,欢迎光临本网站![请登录][注册会员]  
文件名称: JFreeChart中文教程参考
  所属分类: 网页制作
  开发工具:
  文件大小: 7mb
  下载次数: 0
  上传时间: 2011-03-16
  提 供 者: tongw******
 详细说明: /* =========================================================== * JFreeChart : a free chart library for the Java(tm) platform * =========================================================== * * (C) Copyright 2000-2008, by Object Refinery Limited and Contributors. * * Project Info: http://www.jfree.org/jfreechart/index.html * * This library is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation; either version 2.1 of the License, or * (at your option) any later version. * * This library is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, * USA. * * [Java is a trademark or registered trademark of Sun Microsystems, Inc. * in the United States and other countries.] * * ------------------------- * ComparableObjectItem.java * ------------------------- * (C) Copyright 2006-2008, by Object Refinery Limited. * * Original Author: David Gilbert (for Object Refinery Limited); * Contributor(s): -; * * Changes * ------- * 19-Oct-2006 : New class, based on XYDataItem (DG); * */ package org.jfree.data; import java.io.Serializable; import org.jfree.util.ObjectUtilities; /** * Represents one (Comparable, Object) data item for use in a * {@link ComparableObjectSeries}. * * @since 1.0.3 */ public class ComparableObjectItem implements Cloneable, Comparable, Serializable { /** For serialization. */ private static final long serialVersionUID = 2751513470325494890L; /** The x-value. */ private Comparable x; /** The y-value. */ private Object obj; /** * Constructs a new data item. * * @param x the x-value (null NOT permitted). * @param y the y-value (null permitted). */ public ComparableObjectItem(Comparable x, Object y) { if (x == null) { throw new IllegalArgumentException("Null 'x' argument."); } this.x = x; this.obj = y; } /** * Returns the x-value. * * @return The x-value (never null). */ protected Comparable getComparable() { return this.x; } /** * Returns the y-value. * * @return The y-value (possibly null). */ protected Object getObject() { return this.obj; } /** * Sets the y-value for this data item. Note that there is no * corresponding method to change the x-value. * * @param y the new y-value (null permitted). */ protected void setObject(Object y) { this.obj = y; } /** * Returns an integer indicating the order of this object relative to * another object. *

* For the order we consider only the x-value: * negative == "less-than", zero == "equal", positive == "greater-than". * * @param o1 the object being compared to. * * @return An integer indicating the order of this data pair object * relative to another object. */ public int compareTo(Object o1) { int result; // CASE 1 : Comparing to another ComparableObjectItem object // --------------------------------------------------------- if (o1 instanceof ComparableObjectItem) { ComparableObjectItem that = (ComparableObjectItem) o1; return this.x.compareTo(that.x); } // CASE 2 : Comparing to a general object // --------------------------------------------- else { // consider these to be ordered after general objects result = 1; } return result; } /** * Returns a clone of this object. * * @return A clone. * * @throws CloneNotSupportedException not thrown by this class, but * subclasses may differ. */ public Object clone() throws CloneNotSupportedException { return super.clone(); } /** * Tests if this object is equal to another. * * @param obj the object to test against for equality (null * permitted). * * @return A boolean. */ public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof ComparableObjectItem)) { return false; } ComparableObjectItem that = (ComparableObjectItem) obj; if (!this.x.equals(that.x)) { return false; } if (!ObjectUtilities.equal(this.obj, that.obj)) { return false; } return true; } /** * Returns a hash code. * * @return A hash code. */ public int hashCode() { int result; result = this.x.hashCode(); result = 29 * result + (this.obj != null ? this.obj.hashCode() : 0); return result; } } ...展开收缩

(系统自动生成,下载前可以参看下载内容)

下载文件列表

相关说明

  • 本站资源为会员上传分享交流与学习,如有侵犯您的权益,请联系我们删除.
  • 本站是交换下载平台,提供交流渠道,下载内容来自于网络,除下载问题外,其它问题请自行百度
  • 本站已设置防盗链,请勿用迅雷、QQ旋风等多线程下载软件下载资源,下载后用WinRAR最新版进行解压.
  • 如果您发现内容无法下载,请稍后再次尝试;或者到消费记录里找到下载记录反馈给我们.
  • 下载后发现下载的内容跟说明不相乎,请到消费记录里找到下载记录反馈给我们,经确认后退回积分.
  • 如下载前有疑问,可以通过点击"提供者"的名字,查看对方的联系方式,联系对方咨询.
 相关搜索: JFreeChart
 输入关键字,在本站1000多万海量源码库中尽情搜索: