Class SequenceSupport


  • public final class SequenceSupport
    extends java.lang.Object
    A tiny utility class that keeps state for sequences. For use by ImageWriter implementations that supports sequence (multiple images in same stream).
    See Also:
    ImageWriter.canWriteSequence()
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private int index  
    • Constructor Summary

      Constructors 
      Constructor Description
      SequenceSupport()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int advance()
      Advances the current sequence.
      int current()
      Gets the current sequence index.
      int end()
      Ends the current sequence.
      void reset()
      Resets the sequence to initial state, regardless of the current sequence state.
      void start()
      Starts a new sequence.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • index

        private int index
    • Constructor Detail

      • SequenceSupport

        public SequenceSupport()
    • Method Detail

      • reset

        public void reset()
        Resets the sequence to initial state, regardless of the current sequence state.
      • start

        public void start()
        Starts a new sequence.
        Throws:
        java.lang.IllegalStateException - if a sequence is already running.
        See Also:
        ImageWriter.prepareWriteSequence(IIOMetadata)
      • advance

        public int advance()
        Advances the current sequence.
        Returns:
        the current sequence index.
        Throws:
        java.lang.IllegalStateException - if a sequence is not running.
        See Also:
        ImageWriter.writeToSequence(IIOImage, ImageWriteParam)
      • current

        public int current()
        Gets the current sequence index.
        Returns:
        the current sequence index, or -1 if a sequence is not running.
      • end

        public int end()
        Ends the current sequence. The sequence is reset to initial state, and a new sequence may be started.
        Returns:
        the current (last) sequence index
        Throws:
        java.lang.IllegalStateException - if a sequence is not running.
        See Also:
        ImageWriter.endWriteSequence()