Prev Class | Next Class | Frames | No Frames |
Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
java.lang.Object
org.jfree.data.general.AbstractDataset
org.jfree.data.general.DefaultPieDataset
public class DefaultPieDataset
extends AbstractDataset
implements PieDataset, Cloneable, PublicCloneable, Serializable
PieDataset
interface.
Constructor Summary | |
| |
|
Method Summary | |
void |
|
Object |
|
boolean |
|
int |
|
int |
|
Comparable |
|
List |
|
Number |
|
Number |
|
int |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
Methods inherited from class org.jfree.data.general.AbstractDataset | |
addChangeListener , clone , fireDatasetChanged , getGroup , hasListener , notifyListeners , removeChangeListener , setGroup , validateObject |
public DefaultPieDataset(KeyedValues data)
Creates a new dataset by copying data from aKeyedValues
instance.
- Parameters:
data
- the data (null
not permitted).
public void clear()
Clears all data from this dataset and sends aDatasetChangeEvent
to all registered listeners (unless the dataset was already empty).
- Since:
- 1.0.2
public Object clone() throws CloneNotSupportedException
Returns a clone of the dataset.
- Overrides:
- clone in interface AbstractDataset
- Returns:
- A clone.
public boolean equals(Object obj)
Tests if this object is equal to another.
- Parameters:
obj
- the other object.
- Returns:
- A boolean.
public int getIndex(Comparable key)
Returns the index for a key, or -1 if the key is not recognised.
- Specified by:
- getIndex in interface KeyedValues
- Parameters:
key
- the key (null
not permitted).
- Returns:
- The index, or
-1
if the key is unrecognised.
public int getItemCount()
Returns the number of items in the dataset.
- Specified by:
- getItemCount in interface Values
- Returns:
- The item count.
public Comparable getKey(int item)
Returns the key for the specified item, ornull
.
- Specified by:
- getKey in interface KeyedValues
- Parameters:
item
- the item index (in the range0
togetItemCount() - 1
).
- Returns:
- The key, or
null
.
public List getKeys()
Returns the categories in the dataset. The returned list is unmodifiable.
- Specified by:
- getKeys in interface KeyedValues
- Returns:
- The categories in the dataset.
public Number getValue(Comparable key)
Returns the data value associated with a key.
- Specified by:
- getValue in interface KeyedValues
- Parameters:
key
- the key (null
not permitted).
- Returns:
- The value (possibly
null
).
public Number getValue(int item)
Returns a value.
- Parameters:
item
- the value index.
- Returns:
- The value (possibly
null
).
public void insertValue(int position, Comparable key, Number 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 aDatasetChangeEvent
to all registered listeners.
- Parameters:
position
- the position (in the range 0 to getItemCount()).key
- the key (null
not permitted).value
- the value (null
permitted).
- Since:
- 1.0.6
public void insertValue(int position, Comparable key, 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 aDatasetChangeEvent
to all registered listeners.
- Parameters:
position
- the position (in the range 0 to getItemCount()).key
- the key (null
not permitted).value
- the value (null
permitted).
- Since:
- 1.0.6
public void remove(Comparable key)
Removes an item from the dataset and sends aDatasetChangeEvent
to all registered listeners.
- Parameters:
key
- the key (null
not permitted).
public void setValue(Comparable key, Number value)
Sets the data value for a key and sends aDatasetChangeEvent
to all registered listeners.
- Parameters:
key
- the key (null
not permitted).value
- the value.
public void setValue(Comparable key, double value)
Sets the data value for a key and sends aDatasetChangeEvent
to all registered listeners.
- Parameters:
key
- the key (null
not permitted).value
- the value.
public void sortByKeys(SortOrder order)
Sorts the dataset's items by key and sends aDatasetChangeEvent
to all registered listeners.
- Parameters:
order
- the sort order (null
not permitted).
- Since:
- 1.0.3
public void sortByValues(SortOrder order)
Sorts the dataset's items by value and sends aDatasetChangeEvent
to all registered listeners.
- Parameters:
order
- the sort order (null
not permitted).
- Since:
- 1.0.3