Interface WorksetAlgorithm<T,R>


public interface WorksetAlgorithm<T,R>
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Provides a hint to initialize containers appropriately.
    Provide the initial elements that should be processed by update.
    Provides the result of this algorithm's internal action.
    update(T currentT)
    Process the given element and perform its corresponding actions.
  • Method Details

    • expectedElementCount

      int expectedElementCount()
      Provides a hint to initialize containers appropriately.
      Returns:
      expected number of elements visited
    • initialize

      Collection<T> initialize()
      Provide the initial elements that should be processed by update.
      Returns:
      initial elements
    • update

      Collection<T> update(T currentT)
      Process the given element and perform its corresponding actions. If during this process the need arises to update other elements as well, return them.
      Parameters:
      currentT - the current element that should be processed by this method
      Returns:
      a collection of elements that need to be processed
    • result

      R result()
      Provides the result of this algorithm's internal action. More precise, this function returns the accumulated object E after the successful application of all update calls.
      Returns:
      the resulting object