Class ActivityRef<A extends Activity>

  • Type Parameters:
    A - the type of the referenced activity

    public final class ActivityRef<A extends Activity>
    extends Object
    An activity reference is used to precisely identify the location of an activity where the location is a combination of row, layer, and the activity itself. As the same activity can be located on multiple rows and or multiple layers at the same time it is often necessary to work with an activity reference instead of only the activity.
    Since:
    1.0
    • Constructor Detail

      • ActivityRef

        public ActivityRef​(Row<?,​?,​A> row,
                           Layer layer,
                           A activity)
        Constructs a new activity reference.
        Parameters:
        row - the row where the activity is shown
        layer - the model layer where the activity is located (optional)
        activity - the referenced activity
        Since:
        1.0
    • Method Detail

      • isPathExpanded

        public boolean isPathExpanded()
        Determines if the entire row path to the activity is currently expanded or not. An activity will not be shown if the tree path to it is not expanded.
        Returns:
        true if the row path to the activity is completely expanded
        Since:
        1.0
      • getRow

        public Row<?,​?,​A> getRow()
        Returns the row where the activity is located.
        Returns:
        the row where the activity is located
        Since:
        1.0
      • getLayer

        public Layer getLayer()
        The layer on which the activity is shown.
        Returns:
        the layer that is displaying the activity
        Since:
        1.0
      • getActivity

        public A getActivity()
        Returns the activity itself.
        Returns:
        the activity
      • detachFromRow

        public void detachFromRow()
        Removes the activity from the row where it is currently shown.
        Since:
        1.0
        See Also:
        detachFromRow()
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object