Interface ResumableSet<T>

  • Type Parameters:
    T - the indivudal type of each member of the set

    public interface ResumableSet<T>
    An interface that represents a set of resumables (i.e.: files in a directory, rows in a database, etc)
    • Method Detail

      • resumeEach

        default T[] resumeEach​(T[] input,
                               Predicate<T> resumableCheck)
        Iterates over the set of input checking if they should be resumed or not.
        Parameters:
        input - the input array to check for resumables
        resumableCheck - a checker method that returns true if a single entry of the input should be resumed or false otherwise. For instance: given a set A, B and C, where B has already been processed, then a test for A and C returns true, whereas a test for B returns false.
        Returns:
        a new array containing the elements that still need to be processed
      • resumeEach

        void resumeEach​(Predicate<T> resumableCheck)
        Iterates over the set of input checking if they should be resumed or not
        Parameters:
        resumableCheck - a checker method that returns true if a single entry of the input should be resumed or false otherwise. For instance: given a set A, B and C, where B has already been processed, then a test for A and C returns true, whereas a test for B returns false.
      • resumed

        T[] resumed()
        Gets the input that should be resumed
        Returns:
        an array with the input that should be resumed
      • hasResumables

        boolean hasResumables()
        Whether there are resumable entries to process
        Returns:
        true if there are resumable entries or false otherwise