com.jrefinery.data
Class GanttSeries

java.lang.Object
  extended by com.jrefinery.data.Series
      extended by com.jrefinery.data.GanttSeries
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable

public class GanttSeries
extends Series
implements java.io.Serializable

A very basic representation of a list of tasks and time allocations.

This class is used as a building block for the GanttSeriesCollection class that implements the IntervalCategoryDataset that, in turn, can be used to construct simple Gantt charts.

This class is incomplete. It implements the bare minimum required to get a simple demo running.

See Also:
Serialized Form

Field Summary
protected  java.util.List tasks
          A list of tasks.
 
Fields inherited from class com.jrefinery.data.Series
description, listeners, name, propertyChangeSupport
 
Constructor Summary
GanttSeries(java.lang.String name)
          Constructs a new series with the specified name.
 
Method Summary
 void add(java.lang.Object taskId)
           
 GanttTask add(java.lang.Object taskId, TimeAllocation allocation)
          Adds a time allocation for the named task.
 GanttTask findTask(java.lang.Object taskId)
          Returns the task with the specified id.
 int getItemCount()
          Returns the number of items in the series.
 java.util.List getTaskList()
           
 TimeAllocation getTimeAllocation(java.lang.Object taskId, int index)
          Returns the Nth time allocation for the named task.
 int getTimeAllocationCount(java.lang.Object taskId)
          Returns the number of time allocations for the named task.
 void remove(java.lang.Object taskId, TimeAllocation allocation)
           
 
Methods inherited from class com.jrefinery.data.Series
addChangeListener, addPropertyChangeListener, clone, fireSeriesChanged, getDescription, getName, notifyListeners, removeChangeListener, removePropertyChangeListener, setDescription, setName
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

tasks

protected java.util.List tasks
A list of tasks.

Constructor Detail

GanttSeries

public GanttSeries(java.lang.String name)
Constructs a new series with the specified name.

Parameters:
name - The series name.
Method Detail

getItemCount

public int getItemCount()
Returns the number of items in the series.

Returns:
The item count.

findTask

public GanttTask findTask(java.lang.Object taskId)
Returns the task with the specified id.

Parameters:
taskId - Identifier for the task of interest
Returns:
corresponding task returns null if no matching task id found

getTimeAllocation

public TimeAllocation getTimeAllocation(java.lang.Object taskId,
                                        int index)
Returns the Nth time allocation for the named task.

Parameters:
taskId - Identifier for the task of interest
index - 0 based index to the desired time allocation
Returns:
the first time allocation or null if no matching task

getTimeAllocationCount

public int getTimeAllocationCount(java.lang.Object taskId)
Returns the number of time allocations for the named task.

Parameters:
taskId - Identifier for the task of interest
Returns:
the number of time allocations

add

public GanttTask add(java.lang.Object taskId,
                     TimeAllocation allocation)
Adds a time allocation for the named task.

The task id can be any arbitrary Object.

Parameters:
task - The task.
allocation - The time allocation.
Returns:
reference to the affected GanttTask If the task does not exist, it is created with the specified allocation

add

public void add(java.lang.Object taskId)

remove

public void remove(java.lang.Object taskId,
                   TimeAllocation allocation)

getTaskList

public java.util.List getTaskList()


Copyright © 2003 MBARI.

The Monterey Bay Aquarium Research Institute (MBARI) provides this documentation and code "as is", with no warranty, express or implied, of its quality or consistency. It is provided without support and without obligation on the part of MBARI to assist in its use, correction, modification, or enhancement.