| Method from org.jfree.data.category.CategoryToPieDataset Detail: |
public void datasetChanged(DatasetChangeEvent event) {
fireDatasetChanged();
}
Sends a DatasetChangeEvent to all registered listeners, with
this (not the underlying) dataset as the source. |
public boolean equals(Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof PieDataset)) {
return false;
}
PieDataset that = (PieDataset) obj;
int count = getItemCount();
if (that.getItemCount() != count) {
return false;
}
for (int i = 0; i < count; i++) {
Comparable k1 = getKey(i);
Comparable k2 = that.getKey(i);
if (!k1.equals(k2)) {
return false;
}
Number v1 = getValue(i);
Number v2 = that.getValue(i);
if (v1 == null) {
if (v2 != null) {
return false;
}
}
else {
if (!v1.equals(v2)) {
return false;
}
}
}
return true;
}
Tests this dataset for equality with an arbitrary object, returning
true if obj is a dataset containing the same
keys and values in the same order as this dataset. |
public int getExtractIndex() {
return this.index;
}
Returns the index of the row or column from which to extract the data. |
public TableOrder getExtractType() {
return this.extract;
}
Returns the extract type, which determines whether data is read from
one row or one column of the underlying dataset. |
public int getIndex(Comparable key) {
int result = -1;
if (this.source != null) {
if (this.extract == TableOrder.BY_ROW) {
result = this.source.getColumnIndex(key);
}
else if (this.extract == TableOrder.BY_COLUMN) {
result = this.source.getRowIndex(key);
}
}
return result;
}
Returns the index for a given key, or -1 if there is no
such key. |
public int getItemCount() {
int result = 0;
if (this.source != null) {
if (this.extract == TableOrder.BY_ROW) {
result = this.source.getColumnCount();
}
else if (this.extract == TableOrder.BY_COLUMN) {
result = this.source.getRowCount();
}
}
return result;
}
Returns the number of items (values) in the collection. If the
underlying dataset is null, this method returns zero. |
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 key at the specified index. |
public List getKeys() {
List result = Collections.EMPTY_LIST;
if (this.source != null) {
if (this.extract == TableOrder.BY_ROW) {
result = this.source.getColumnKeys();
}
else if (this.extract == TableOrder.BY_COLUMN) {
result = this.source.getRowKeys();
}
}
return result;
}
Returns the keys for the dataset.
If the underlying dataset is null, this method returns an
empty list. |
public CategoryDataset getUnderlyingDataset() {
return this.source;
}
Returns the underlying dataset. |
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;
}
Returns a value from the dataset. |
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;
}
Returns the value for a given key. If the key is not recognised, the
method should return null (but note that null
can be associated with a valid key also). |