interface.
| Method from org.jfree.data.general.DefaultPieDataset Detail: |
public void clear() {
if (getItemCount() > 0) {
this.data.clear();
fireDatasetChanged();
}
}
Clears all data from this dataset and sends a DatasetChangeEvent
to all registered listeners (unless the dataset was already empty). |
public Object clone() throws CloneNotSupportedException {
DefaultPieDataset clone = (DefaultPieDataset) super.clone();
clone.data = (DefaultKeyedValues) this.data.clone();
return clone;
}
Returns a clone of the dataset. |
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 if this object is equal to another. |
public int getIndex(Comparable key) {
return this.data.getIndex(key);
}
Returns the index for a key, or -1 if the key is not recognised. |
public int getItemCount() {
return this.data.getItemCount();
}
Returns the number of items in the dataset. |
public Comparable getKey(int item) {
return this.data.getKey(item);
}
Returns the key for the specified item, or null. |
public List getKeys() {
return Collections.unmodifiableList(this.data.getKeys());
}
Returns the categories in the dataset. The returned list is
unmodifiable. |
public Number getValue(int item) {
Number result = null;
if (getItemCount() > item) {
result = this.data.getValue(item);
}
return result;
}
|
public Number getValue(Comparable key) {
if (key == null) {
throw new IllegalArgumentException("Null 'key' argument.");
}
return this.data.getValue(key);
}
Returns the data value associated with a key. |
public int hashCode() {
return this.data.hashCode();
}
|
public void insertValue(int position,
Comparable key,
double value) {
insertValue(position, key, new Double(value));
}
Inserts a new value at the specified position in the dataset or, if
there is an existing item with the specified key, updates the value
for that item and moves it to the specified position. After the change
is made, this methods sends a DatasetChangeEvent to all
registered listeners. |
public void insertValue(int position,
Comparable key,
Number value) {
this.data.insertValue(position, key, value);
fireDatasetChanged();
}
Inserts a new value at the specified position in the dataset or, if
there is an existing item with the specified key, updates the value
for that item and moves it to the specified position. After the change
is made, this methods sends a DatasetChangeEvent to all
registered listeners. |
public void remove(Comparable key) {
this.data.removeValue(key);
fireDatasetChanged();
}
Removes an item from the dataset and sends a DatasetChangeEvent
to all registered listeners. |
public void setValue(Comparable key,
Number value) {
this.data.setValue(key, value);
fireDatasetChanged();
}
|
public void setValue(Comparable key,
double value) {
setValue(key, new Double(value));
}
|
public void sortByKeys(SortOrder order) {
this.data.sortByKeys(order);
fireDatasetChanged();
}
Sorts the dataset's items by key and sends a DatasetChangeEvent
to all registered listeners. |
public void sortByValues(SortOrder order) {
this.data.sortByValues(order);
fireDatasetChanged();
}
Sorts the dataset's items by value and sends a DatasetChangeEvent
to all registered listeners. |