ilog.views.gantt
Interface IlvActivity

All Superinterfaces:
IlvHierarchyNode
All Known Implementing Classes:
IlvAbstractActivity, IlvGeneralActivity, IlvNullActivity, IlvSimpleActivity, IlvTableActivity

public interface IlvActivity
extends IlvHierarchyNode

The class IlvActivity defines the abstract behavior of a Gantt activity. Each activity has a name, an identifier, a start time, and an end time. Storage and lookup of IlvActivity instances is expected to be identity-based. Therefore, the default hashCode() and equals() methods inherited from java.lang.Object should not be overridden.

IlvActivity implementations are expected to route their property change events to the Gantt data model. Therefore, although there is no accessor to the data model in this interface, the activity implementation must have some method of obtaining the model it belongs to. Here is an example of how the IlvActivity implementation should fire its property change events:

 void fireEvent(ActivityEvent event) {
   IlvGanttModel model = .....
   if (model != null)
     model.fireActivityEvent(event);
 }
 


Method Summary
 IlvUnaryPredicate getChildEventFilter()
          Returns a predicate that will be used to determine the events from this activity's children that should be dispatched to this activity's processChildEvent(ilog.views.gantt.event.ActivityEvent) method.
 Date getEndTime()
          Returns the end time of the activity.
 String getID()
          Returns the ID string of the activity.
 String getName()
          Returns the name of the activity.
 Date getStartTime()
          Returns the start time of the activity.
 IlvTimeInterval getTimeInterval()
          Returns the time span between the start time and end time of the activity as an interval.
 void processChildEvent(ActivityEvent event)
          This method is invoked by the Gantt data model for any events fired by the children of this activity and for which the predicate returned by getChildEventFilter() evaluates to true.
 void setEndTime(Date t)
          Sets the end time of the activity.
 void setGanttModelImpl(IlvGanttModel model)
          This method is invoked by the IlvGanttModel when the activity is added or removed.
 void setID(String id)
          Sets the ID string of the activity.
 void setName(String name)
          Sets the name of the activity.
 void setStartTime(Date t)
          Sets the start time of the activity.
 void setTimeInterval(Date start, Date end)
          Sets the start time and end time of the activity.
 void setTimeInterval(IlvTimeInterval interval)
          Sets the start time and end time of the activity.
 

Method Detail

getID

String getID()
Returns the ID string of the activity.

Returns:
The activity ID.

setID

void setID(String id)
Sets the ID string of the activity.

Parameters:
id - The activity's ID string.

getName

String getName()
Returns the name of the activity.

Returns:
The activity name.

setName

void setName(String name)
Sets the name of the activity.

Parameters:
name - A descriptive name for this activity.

getStartTime

Date getStartTime()
Returns the start time of the activity.

Returns:
The activity start time.

setStartTime

void setStartTime(Date t)
Sets the start time of the activity. The invariant is maintained whereby the start time must always be prior or equal to the end time. Therefore, if t > getEndTime(), t will actually become the new end time and the previous end time will become the new start time.

Parameters:
t - The start time.

getEndTime

Date getEndTime()
Returns the end time of the activity.

Returns:
The activity end time.

setEndTime

void setEndTime(Date t)
Sets the end time of the activity. The invariant is maintained whereby the start time must always be prior or equal to the end time. Therefore, if t < getStartTime(), t will actually become the new start time and the previous start time will become the new end time.

Parameters:
t - The end time.

getTimeInterval

IlvTimeInterval getTimeInterval()
Returns the time span between the start time and end time of the activity as an interval.

Returns:
The activity time interval.

setTimeInterval

void setTimeInterval(IlvTimeInterval interval)
Sets the start time and end time of the activity.

Parameters:
interval - The start and end time.

setTimeInterval

void setTimeInterval(Date start,
                     Date end)
Sets the start time and end time of the activity. The invariant is maintained whereby the start time must always be prior or equal to its end time. Therefore, if end < start, the values will be silently swapped and start will actually become the new end time while end will become the new start time.

Parameters:
start - The start time.
end - The end time.

getChildEventFilter

IlvUnaryPredicate getChildEventFilter()
Returns a predicate that will be used to determine the events from this activity's children that should be dispatched to this activity's processChildEvent(ilog.views.gantt.event.ActivityEvent) method. The Gantt data model applies the predicate to all ActivityEvents events fired by the children of this activity. If the predicate evaluates to true, then the Gantt data model dispatches the child event to the processChildEvent() method. This allows you to easily implement a parent activity property that is automatically computed from one or more properties of its children.

Returns:
The predicate used to filter events from the activity's children.

processChildEvent

void processChildEvent(ActivityEvent event)
This method is invoked by the Gantt data model for any events fired by the children of this activity and for which the predicate returned by getChildEventFilter() evaluates to true. This allows you to easily implement a parent activity property that is automatically computed from one or more properties of its children.

Parameters:
event - The child activity event.

setGanttModelImpl

void setGanttModelImpl(IlvGanttModel model)
This method is invoked by the IlvGanttModel when the activity is added or removed.

Warning: This method is considered to be part of an IlvActivity's internal implementation and is not a public API. You should only invoke this method directly if you have created your own IlvGanttModel implementation.

Parameters:
model - The data model that this activity has been added to, or null if this activity has been removed from the data model.


Copyright © 1996-2007 ILOG S.A. All rights reserved.   Documentation homepage.