- java.lang.Object
-
- org.jfree.data.general.Series<K>
-
- org.jfree.data.gantt.TaskSeries<K>
-
- All Implemented Interfaces:
Serializable,Cloneable
public class TaskSeries<K extends Comparable<K>> extends Series<K>
A series that contains zero, one or manyTaskobjects.This class is used as a building block for the
TaskSeriesCollectionclass that can be used to construct basic Gantt charts.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description TaskSeries(K name)Constructs a new series with the specified name.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(Task task)Adds a task to the series and sends aSeriesChangeEventto all registered listeners.Objectclone()Returns an independent copy of this series.booleanequals(Object obj)Tests this object for equality with an arbitrary object.Taskget(int index)Returns a task from the series.Taskget(String description)Returns the task in the series that has the specified description.intgetItemCount()Returns the number of items in the series.List<Task>getTasks()Returns an unmodifialble list of the tasks in the series.inthashCode()Returns a hash code.voidremove(Task task)Removes a task from the series and sends aSeriesChangeEventto all registered listeners.voidremoveAll()Removes all tasks from the series and sends aSeriesChangeEventto all registered listeners.-
Methods inherited from class org.jfree.data.general.Series
addChangeListener, fireSeriesChanged, getKey, getNotify, isEmpty, notifyListeners, removeChangeListener, setNotify
-
-
-
-
Constructor Detail
-
TaskSeries
public TaskSeries(K name)
Constructs a new series with the specified name.- Parameters:
name- the series name (nullnot permitted).
-
-
Method Detail
-
add
public void add(Task task)
Adds a task to the series and sends aSeriesChangeEventto all registered listeners.- Parameters:
task- the task (nullnot permitted).
-
remove
public void remove(Task task)
Removes a task from the series and sends aSeriesChangeEventto all registered listeners.- Parameters:
task- the task.
-
removeAll
public void removeAll()
Removes all tasks from the series and sends aSeriesChangeEventto all registered listeners.
-
getItemCount
public int getItemCount()
Returns the number of items in the series.- Specified by:
getItemCountin classSeries<K extends Comparable<K>>- Returns:
- The item count.
-
get
public Task get(int index)
Returns a task from the series.- Parameters:
index- the task index (zero-based).- Returns:
- The task.
-
get
public Task get(String description)
Returns the task in the series that has the specified description.- Parameters:
description- the name (nullnot permitted).- Returns:
- The task (possibly
null).
-
getTasks
public List<Task> getTasks()
Returns an unmodifialble list of the tasks in the series.- Returns:
- The tasks.
-
equals
public boolean equals(Object obj)
Tests this object for equality with an arbitrary object.- Overrides:
equalsin classSeries<K extends Comparable<K>>- Parameters:
obj- the object to test against (nullpermitted).- Returns:
- A boolean.
-
hashCode
public int hashCode()
Description copied from class:SeriesReturns a hash code.- Overrides:
hashCodein classSeries<K extends Comparable<K>>- Returns:
- A hash code.
-
clone
public Object clone() throws CloneNotSupportedException
Returns an independent copy of this series.- Overrides:
clonein classSeries<K extends Comparable<K>>- Returns:
- A clone of the series.
- Throws:
CloneNotSupportedException- if there is some problem cloning the dataset.
-
-