Interface LargeSourceSet

All Known Implementing Classes:
InMemoryLargeSourceSet

public interface LargeSourceSet
A source set that may be too large to be materialized in memory. It contains operations for filtering and mapping that are optimized for large repositories, though the same operations work on small repositories.

A large source set must always track of its initial state to be able to produce getChangeset() from that initial state through any number of transformations to some end state.

  • Method Details

    • beforeCycle

      default void beforeCycle()
      Called by RecipeScheduler at the beginning of a scan/generate/edit cycle.
    • setRecipe

      void setRecipe(List<Recipe> recipeStack)
      Maintain context about what recipe is performing an edit or generating code.
      Parameters:
      recipeStack - A stack rooted at the currently operating recipe and extending up its containing recipes to top-level recipe that a developer is running directly.
    • edit

      Execute a transformation on all items.
      Parameters:
      map - A transformation on T
      Returns:
      A new source set if the map function results in any changes, otherwise this source set is returned.
    • generate

      Concatenate new items. Where possible, implementations should not iterate the entire source set in order to accomplish this, since the ordering of SourceFile is not significant.
      Parameters:
      ls - The new item to insert
      Returns:
      A new source set with the new item inserted.
    • afterCycle

      default void afterCycle(boolean lastCycle)
      Called by RecipeScheduler at the conclusion of a scan/generate/edit cycle.
    • getChangeset

      Changeset getChangeset()
      Returns:
      The set of changes (encompassing adds, edits, and deletions) to the initial state.