@Override @SuppressWarnings("unchecked") public Dataset getDataset() { CategoryDataset dataset = (CategoryDataset) super.getDataset(); return new CategoryToPieDataset(dataset, TableOrder.BY_ROW, 0); } }
/** * Sends a {@link DatasetChangeEvent} to all registered listeners, with * this (not the underlying) dataset as the source. * * @param event the event (ignored, a new event with this dataset as the * source is sent to the listeners). */ @Override public void datasetChanged(DatasetChangeEvent event) { fireDatasetChanged(); }
int count = getItemCount(); if (that.getItemCount() != count) { return false; Comparable k1 = getKey(i); Comparable k2 = that.getKey(i); if (!k1.equals(k2)) { Number v1 = getValue(i); Number v2 = that.getValue(i); if (v1 == null) {
/** * Returns the key at the specified index. * * @param index the item index (in the range {@code 0} to * {@code getItemCount() -1}). * * @return The key. * * @throws IndexOutOfBoundsException if {@code index} is not in the * specified range. */ @Override public Comparable getKey(int index) { Comparable result = null; if (index < 0 || index >= getItemCount()) { // this includes the case where the underlying dataset is null throw new IndexOutOfBoundsException("Invalid 'index': " + index); } if (this.extract == TableOrder.BY_ROW) { result = this.source.getColumnKey(index); } else if (this.extract == TableOrder.BY_COLUMN) { result = this.source.getRowKey(index); } return result; }
/** * Returns the value for a given key. If the key is not recognised, the * method should return {@code null} (but note that {@code null} * can be associated with a valid key also). * * @param key the key. * * @return The value (possibly {@code null}). */ @Override public Number getValue(Comparable key) { Number result = null; int keyIndex = getIndex(key); if (keyIndex != -1) { if (this.extract == TableOrder.BY_ROW) { result = this.source.getValue(this.index, keyIndex); } else if (this.extract == TableOrder.BY_COLUMN) { result = this.source.getValue(keyIndex, this.index); } } return result; }
int count = getItemCount(); if (that.getItemCount() != count) { return false; Comparable k1 = getKey(i); Comparable k2 = that.getKey(i); if (!k1.equals(k2)) { Number v1 = getValue(i); Number v2 = that.getValue(i); if (v1 == null) {
/** * Returns the key at the specified index. * * @param index the item index (in the range <code>0</code> to * <code>getItemCount() - 1</code>). * * @return The key. * * @throws IndexOutOfBoundsException if <code>index</code> is not in the * specified range. */ public Comparable getKey(int index) { Comparable result = null; if (index < 0 || index >= getItemCount()) { // this includes the case where the underlying dataset is null throw new IndexOutOfBoundsException("Invalid 'index': " + index); } if (this.extract == TableOrder.BY_ROW) { result = this.source.getColumnKey(index); } else if (this.extract == TableOrder.BY_COLUMN) { result = this.source.getRowKey(index); } return result; }
/** * Returns the value for a given key. If the key is not recognised, the * method should return <code>null</code> (but note that <code>null</code> * can be associated with a valid key also). * * @param key the key. * * @return The value (possibly <code>null</code>). */ public Number getValue(Comparable key) { Number result = null; int keyIndex = getIndex(key); if (keyIndex != -1) { if (this.extract == TableOrder.BY_ROW) { result = this.source.getValue(this.index, keyIndex); } else if (this.extract == TableOrder.BY_COLUMN) { result = this.source.getValue(keyIndex, this.index); } } return result; }
PieDataset dd = new CategoryToPieDataset(this.dataset, this.dataExtractOrder, pieIndex); if (this.limit > 0.0) {
/** * Returns a value from the dataset. * * @param item the item index (zero-based). * * @return The value (possibly {@code null}). * * @throws IndexOutOfBoundsException if {@code item} is not in the * range {@code 0} to {@code getItemCount() -1}. */ @Override public Number getValue(int item) { Number result = null; if (item < 0 || item >= getItemCount()) { // this will include the case where the underlying dataset is null throw new IndexOutOfBoundsException( "The 'item' index is out of bounds."); } if (this.extract == TableOrder.BY_ROW) { result = this.source.getValue(this.index, item); } else if (this.extract == TableOrder.BY_COLUMN) { result = this.source.getValue(item, this.index); } return result; }
/** * Sends a {@link DatasetChangeEvent} to all registered listeners, with * this (not the underlying) dataset as the source. * * @param event the event (ignored, a new event with this dataset as the * source is sent to the listeners). */ public void datasetChanged(DatasetChangeEvent event) { fireDatasetChanged(); }
PieDataset dd = new CategoryToPieDataset(this.dataset, this.dataExtractOrder, pieIndex); if (this.limit > 0.0) {
/** * Returns a value from the dataset. * * @param item the item index (zero-based). * * @return The value (possibly <code>null</code>). * * @throws IndexOutOfBoundsException if <code>item</code> is not in the * range <code>0</code> to <code>getItemCount() - 1</code>. */ public Number getValue(int item) { Number result = null; if (item < 0 || item >= getItemCount()) { // this will include the case where the underlying dataset is null throw new IndexOutOfBoundsException( "The 'item' index is out of bounds."); } if (this.extract == TableOrder.BY_ROW) { result = this.source.getValue(this.index, item); } else if (this.extract == TableOrder.BY_COLUMN) { result = this.source.getValue(item, this.index); } return result; }
PieDataset dd = new CategoryToPieDataset(getDataset(), getDataExtractOrder(), pieIndex); if(getLimit() > 0.0)