📄 xyseries.html
字号:
<FONT color="green">598</FONT> public Object clone() throws CloneNotSupportedException {<a name="line.598"></a><FONT color="green">599</FONT> Object clone = createCopy(0, getItemCount() - 1);<a name="line.599"></a><FONT color="green">600</FONT> return clone;<a name="line.600"></a><FONT color="green">601</FONT> }<a name="line.601"></a><FONT color="green">602</FONT> <a name="line.602"></a><FONT color="green">603</FONT> /**<a name="line.603"></a><FONT color="green">604</FONT> * Creates a new series by copying a subset of the data in this time series.<a name="line.604"></a><FONT color="green">605</FONT> *<a name="line.605"></a><FONT color="green">606</FONT> * @param start the index of the first item to copy.<a name="line.606"></a><FONT color="green">607</FONT> * @param end the index of the last item to copy.<a name="line.607"></a><FONT color="green">608</FONT> *<a name="line.608"></a><FONT color="green">609</FONT> * @return A series containing a copy of this series from start until end.<a name="line.609"></a><FONT color="green">610</FONT> * <a name="line.610"></a><FONT color="green">611</FONT> * @throws CloneNotSupportedException if there is a cloning problem.<a name="line.611"></a><FONT color="green">612</FONT> */<a name="line.612"></a><FONT color="green">613</FONT> public XYSeries createCopy(int start, int end) <a name="line.613"></a><FONT color="green">614</FONT> throws CloneNotSupportedException {<a name="line.614"></a><FONT color="green">615</FONT> <a name="line.615"></a><FONT color="green">616</FONT> XYSeries copy = (XYSeries) super.clone();<a name="line.616"></a><FONT color="green">617</FONT> copy.data = new java.util.ArrayList();<a name="line.617"></a><FONT color="green">618</FONT> if (this.data.size() > 0) {<a name="line.618"></a><FONT color="green">619</FONT> for (int index = start; index <= end; index++) {<a name="line.619"></a><FONT color="green">620</FONT> XYDataItem item = (XYDataItem) this.data.get(index);<a name="line.620"></a><FONT color="green">621</FONT> XYDataItem clone = (XYDataItem) item.clone();<a name="line.621"></a><FONT color="green">622</FONT> try {<a name="line.622"></a><FONT color="green">623</FONT> copy.add(clone);<a name="line.623"></a><FONT color="green">624</FONT> }<a name="line.624"></a><FONT color="green">625</FONT> catch (SeriesException e) {<a name="line.625"></a><FONT color="green">626</FONT> System.err.println("Unable to add cloned data item.");<a name="line.626"></a><FONT color="green">627</FONT> }<a name="line.627"></a><FONT color="green">628</FONT> }<a name="line.628"></a><FONT color="green">629</FONT> }<a name="line.629"></a><FONT color="green">630</FONT> return copy;<a name="line.630"></a><FONT color="green">631</FONT> <a name="line.631"></a><FONT color="green">632</FONT> }<a name="line.632"></a><FONT color="green">633</FONT> <a name="line.633"></a><FONT color="green">634</FONT> /**<a name="line.634"></a><FONT color="green">635</FONT> * Tests this series for equality with an arbitrary object.<a name="line.635"></a><FONT color="green">636</FONT> *<a name="line.636"></a><FONT color="green">637</FONT> * @param obj the object to test against for equality <a name="line.637"></a><FONT color="green">638</FONT> * (<code>null</code> permitted).<a name="line.638"></a><FONT color="green">639</FONT> *<a name="line.639"></a><FONT color="green">640</FONT> * @return A boolean.<a name="line.640"></a><FONT color="green">641</FONT> */<a name="line.641"></a><FONT color="green">642</FONT> public boolean equals(Object obj) {<a name="line.642"></a><FONT color="green">643</FONT> if (obj == this) {<a name="line.643"></a><FONT color="green">644</FONT> return true;<a name="line.644"></a><FONT color="green">645</FONT> }<a name="line.645"></a><FONT color="green">646</FONT> if (!(obj instanceof XYSeries)) {<a name="line.646"></a><FONT color="green">647</FONT> return false;<a name="line.647"></a><FONT color="green">648</FONT> }<a name="line.648"></a><FONT color="green">649</FONT> if (!super.equals(obj)) {<a name="line.649"></a><FONT color="green">650</FONT> return false;<a name="line.650"></a><FONT color="green">651</FONT> }<a name="line.651"></a><FONT color="green">652</FONT> XYSeries that = (XYSeries) obj;<a name="line.652"></a><FONT color="green">653</FONT> if (this.maximumItemCount != that.maximumItemCount) {<a name="line.653"></a><FONT color="green">654</FONT> return false;<a name="line.654"></a><FONT color="green">655</FONT> }<a name="line.655"></a><FONT color="green">656</FONT> if (this.autoSort != that.autoSort) {<a name="line.656"></a><FONT color="green">657</FONT> return false;<a name="line.657"></a><FONT color="green">658</FONT> }<a name="line.658"></a><FONT color="green">659</FONT> if (this.allowDuplicateXValues != that.allowDuplicateXValues) {<a name="line.659"></a><FONT color="green">660</FONT> return false;<a name="line.660"></a><FONT color="green">661</FONT> }<a name="line.661"></a><FONT color="green">662</FONT> if (!ObjectUtilities.equal(this.data, that.data)) {<a name="line.662"></a><FONT color="green">663</FONT> return false;<a name="line.663"></a><FONT color="green">664</FONT> }<a name="line.664"></a><FONT color="green">665</FONT> return true;<a name="line.665"></a><FONT color="green">666</FONT> }<a name="line.666"></a><FONT color="green">667</FONT> <a name="line.667"></a><FONT color="green">668</FONT> /**<a name="line.668"></a><FONT color="green">669</FONT> * Returns a hash code.<a name="line.669"></a><FONT color="green">670</FONT> * <a name="line.670"></a><FONT color="green">671</FONT> * @return A hash code.<a name="line.671"></a><FONT color="green">672</FONT> */<a name="line.672"></a><FONT color="green">673</FONT> public int hashCode() {<a name="line.673"></a><FONT color="green">674</FONT> int result = super.hashCode();<a name="line.674"></a><FONT color="green">675</FONT> result = 29 * result + (this.data != null ? this.data.hashCode() : 0);<a name="line.675"></a><FONT color="green">676</FONT> result = 29 * result + this.maximumItemCount;<a name="line.676"></a><FONT color="green">677</FONT> result = 29 * result + (this.autoSort ? 1 : 0);<a name="line.677"></a><FONT color="green">678</FONT> result = 29 * result + (this.allowDuplicateXValues ? 1 : 0);<a name="line.678"></a><FONT color="green">679</FONT> return result;<a name="line.679"></a><FONT color="green">680</FONT> }<a name="line.680"></a><FONT color="green">681</FONT> <a name="line.681"></a><FONT color="green">682</FONT> }<a name="line.682"></a><FONT color="green">683</FONT> <a name="line.683"></a></PRE></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -