com.miginfocom.calendar.activity
Interface ActivityConstraint

All Known Implementing Classes:
ActivityDateRangeConstraint

public interface ActivityConstraint

Interface to implement to enforce a one way constraint.

It might be for instance to set the start date/time of the target to the end time of the source or to set the Category ids for the target to that of the source.


Method Summary
 void enforce(Activity[] sources, Activity[] targets)
          Do something to the target with the source as a reference.
 boolean isValid(Activity[] sources, Activity[] targets)
          If the current constraint is vaild and thus don't need to be enforced.
 

Method Detail

enforce

void enforce(Activity[] sources,
             Activity[] targets)
             throws java.beans.PropertyVetoException
Do something to the target with the source as a reference.

Parameters:
sources - The sources. NOTE! Might be null to accomodate for contraints that doesn't need a source.
targets - The target. Never null.
Throws:
java.beans.PropertyVetoException - If the property couldn't be set on target for some reason.

isValid

boolean isValid(Activity[] sources,
                Activity[] targets)
If the current constraint is vaild and thus don't need to be enforced. Note that a call to enforce(Activity[], Activity[]) does not have to put the constraint in a valid mode since the enforcement could be vetoed due to a number of reasons.

Parameters:
sources - The sources. NOTE! Might be null to accomodate for contraints that doesn't need a source.
targets - The target. Never null.
Returns:
If the current constraint is vaild and thus don't need to be enforced, or rather an enforce would not change the state of anything.


Copyright © 2009 MiG InfoCom AB. All Rights Reserved.