Class ActivityLink<A extends Activity>

  • Type Parameters:
    A - the type of the two activities being linked together

    public class ActivityLink<A extends Activity>
    extends Object
    An activity link can be used to model any kind of dependency between two activities. In project planning applications a link would express a predecessor / successor relationship between two tasks, for example "task A must be finished before task B can begin". In other domains a link might simply express that two or more activities need to be scheduled together and that moving one of them requires all others to be moved, too.
    Since:
    1.0
    • Constructor Detail

      • ActivityLink

        public ActivityLink​(ActivityRef<A> sourceRef,
                            ActivityRef<A> targetRef,
                            ActivityLink.LinkType type)
        Constructs a new activity link.
        Parameters:
        sourceRef - an activity reference pointing to the link source
        targetRef - an activity reference pointing to the link target
        type - the type of the link (E-S, S-E, S-S, E-E)
        Since:
        1.0
      • ActivityLink

        public ActivityLink​(ActivityRef<A> sourceRef,
                            ActivityRef<A> targetRef)
        Constructs a new activity link with type ActivityLink.LinkType.END_TO_START.
        Parameters:
        sourceRef - an activity reference pointing to the link source
        targetRef - an activity reference pointing to the link target
        Since:
        1.0
    • Method Detail

      • setSourceActivityRef

        public void setSourceActivityRef​(ActivityRef<A> ref)
        Sets the activity reference pointing to the source activity of the link.
        Parameters:
        ref - the source activity reference
        Since:
        1.0
      • getSourceActivityRef

        public final ActivityRef<A> getSourceActivityRef()
        Returns the activity reference pointing to the source activity of the link.
        Returns:
        the source activity reference
        Since:
        1.0
      • setTargetActivityRef

        public void setTargetActivityRef​(ActivityRef<A> ref)
        Sets the activity reference pointing to the target activity of the link.
        Parameters:
        ref - the target activity reference
        Since:
        1.0
      • getTargetActivityRef

        public final ActivityRef<A> getTargetActivityRef()
        Returns the activity reference pointing to the target activity of the link.
        Returns:
        the target activity reference
        Since:
        1.0
      • getType

        public final ActivityLink.LinkType getType()
        Returns the link type (S-S, S-E, E-S, E-E).
        Returns:
        the link type
        Since:
        1.0
      • setType

        public void setType​(ActivityLink.LinkType type)
        Sets the link type (S-S, S-E, E-S, E-E).
        Parameters:
        type - the link type
        Since:
        1.0