Class AbstractSequenceTask

    • Constructor Detail

      • AbstractSequenceTask

        public AbstractSequenceTask()
    • Method Detail

      • getSequenceIndex

        public int getSequenceIndex()
        Returns the index in the sequence. This is a constrained property of type Integer.
        Specified by:
        getSequenceIndex in interface SequenceTask
        Returns:
        The index in the sequence, or -1 if the sequence has not started.
      • setSequenceIndex

        protected void setSequenceIndex​(int newSequenceIndex)
                                 throws java.beans.PropertyVetoException
        Goes to the indicated index in the sequence. This is a bound property of type Integer.
        Parameters:
        newSequenceIndex - The new index in the sequence.
        Throws:
        java.lang.IllegalArgumentException - if the given sequence index is not within the allowed range.
        java.beans.PropertyVetoException - if the sequence index change has been vetoed.
        See Also:
        SequenceTask.SEQUENCE_INDEX_PROPERTY, getMinSequenceIndex(), getMaxSequenceIndex()
      • getMinSequenceIndex

        protected int getMinSequenceIndex()
        Determines the current lowest valid sequence index. This method is called to validate the allowed range of the sequence index. This version returns 0.
        Returns:
        The current lowest valid sequence index, inclusive.
      • getMaxSequenceIndex

        protected int getMaxSequenceIndex()
        Determines the current highest valid sequence index. This method is called to validate the allowed range of the sequence index. This version returns Integer.MAX_VALUE.
        Returns:
        The current highest valid sequence index, inclusive.
      • goStart

        public void goStart()
        Starts the sequence annd goes to the first step in the sequence. If the sequence is already started, no action occurs. This implementation delegates to start(), which derived classes should override instead of this method.
        Specified by:
        goStart in interface SequenceTask
        See Also:
        start()
      • start

        protected void start()
        Starts the sequence by going to the first step in the sequence. This implementation sets the task state to TaskState.INCOMPLETE. This implementation calls goFirst().
        Throws:
        java.lang.IllegalStateException - if the task has already been started.
        See Also:
        goFirst()
      • goFirst

        public void goFirst()
                     throws java.beans.PropertyVetoException
        Goes to the first step in the sequence. This implementation delegates to first(), which derived classes should override instead of this method.
        Specified by:
        goFirst in interface SequenceTask
        Throws:
        java.beans.PropertyVetoException - if the sequence index change has been vetoed.
        See Also:
        first()
      • first

        protected abstract void first()
                               throws java.beans.PropertyVetoException
        Goes to the first step in the sequence.
        Throws:
        java.beans.PropertyVetoException - if the sequence index change has been vetoed.
      • hasPrevious

        public abstract boolean hasPrevious()
        Determines if there is a previous step in the sequence.
        Specified by:
        hasPrevious in interface SequenceTask
        Returns:
        true if there is a previous step before the current one.
      • goPrevious

        public void goPrevious()
                        throws java.beans.PropertyVetoException
        Goes to the previous step in the sequence. If there is no previous component, no action occurs. This implementation delegates to previous(), which derived classes should override instead of this method.
        Specified by:
        goPrevious in interface SequenceTask
        Throws:
        java.beans.PropertyVetoException - if the sequence index change has been vetoed.
        See Also:
        hasPrevious(), previous()
      • previous

        protected abstract void previous()
                                  throws java.beans.PropertyVetoException
        Goes to the previous step in the sequence. If there is no previous step, no action occurs.
        Throws:
        java.beans.PropertyVetoException - if the sequence index change has been vetoed.
      • hasNext

        public abstract boolean hasNext()
        Determines if there is a next step in the sequence.
        Specified by:
        hasNext in interface SequenceTask
        Returns:
        true if there is a next step after the current one.
      • goNext

        public void goNext()
                    throws java.beans.PropertyVetoException
        Goes to the next step in the sequence. If there is no next step, no action occurs. This implementation delegates to next(), which derived classes should override instead of this method.
        Specified by:
        goNext in interface SequenceTask
        Throws:
        java.beans.PropertyVetoException - if the sequence index change has been vetoed.
        See Also:
        hasNext(), next()
      • next

        protected abstract void next()
                              throws java.beans.PropertyVetoException
        Goes to the next step in the sequence. If there is no next step, no action occurs.
        Throws:
        java.beans.PropertyVetoException - if the sequence index change has been vetoed.
      • goFinish

        public void goFinish()
        Verifies the contents and finishes the sequence. This implementation delegates to finish(), which derived classes should override instead of this method.
        Specified by:
        goFinish in interface SequenceTask
        See Also:
        finish()
      • finish

        protected void finish()
        Finishes the sequence. This implementation sets the task state to TaskState.INCOMPLETE.