Interface DeltaSetTriple<T>

All Superinterfaces:
DebugDumpable, Foreachable<T>, Serializable, ShortDumpable, SimpleVisitable<T>
All Known Subinterfaces:
PrismValueDeltaSetTriple<V>
All Known Implementing Classes:
AbstractDelegatedPrismValueDeltaSetTriple

public interface DeltaSetTriple<T> extends DebugDumpable, ShortDumpable, Serializable, SimpleVisitable<T>, Foreachable<T>
The triple of values (added, unchanged, deleted) that represents difference between two collections of values.

The DeltaSetTriple is used as a result of a "diff" operation or it is constructed to determine a ObjectDelta or PropertyDelta. It is a very useful structure in numerous situations when dealing with relative changes.

DeltaSetTriple (similarly to other parts of this system) deal only with unordered values.

Author:
Radovan Semancik
  • Method Details

    • diff

      static <T> DeltaSetTriple<T> diff(Collection<T> valuesOld, Collection<T> valuesNew, PrismContext prismContext)
      Compares two (unordered) collections and creates a triple describing the differences.
    • getZeroSet

      @NotNull @NotNull Collection<T> getZeroSet()
    • getPlusSet

      @NotNull @NotNull Collection<T> getPlusSet()
    • getMinusSet

      @NotNull @NotNull Collection<T> getMinusSet()
    • hasPlusSet

      boolean hasPlusSet()
    • hasZeroSet

      boolean hasZeroSet()
    • hasMinusSet

      boolean hasMinusSet()
    • isZeroOnly

      boolean isZeroOnly()
    • addToPlusSet

      void addToPlusSet(T item)
    • addToMinusSet

      void addToMinusSet(T item)
    • addToZeroSet

      void addToZeroSet(T item)
    • addAllToPlusSet

      void addAllToPlusSet(Collection<T> items)
    • addAllToMinusSet

      void addAllToMinusSet(Collection<T> items)
    • addAllToZeroSet

      void addAllToZeroSet(Collection<T> items)
    • getSet

      Collection<T> getSet(PlusMinusZero whichSet)
    • addAllToSet

      void addAllToSet(PlusMinusZero destination, Collection<T> items)
    • addToSet

      void addToSet(PlusMinusZero destination, T item)
    • presentInPlusSet

      boolean presentInPlusSet(T item)
    • presentInMinusSet

      boolean presentInMinusSet(T item)
    • presentInZeroSet

      boolean presentInZeroSet(T item)
    • clearPlusSet

      void clearPlusSet()
    • clearMinusSet

      void clearMinusSet()
    • clearZeroSet

      void clearZeroSet()
    • size

      int size()
    • union

      Collection<T> union()
      Returns all values, regardless of the internal sets.
    • getAnyValue

      T getAnyValue()
    • getAllValues

      Collection<T> getAllValues()
    • stream

      Stream<T> stream()
    • getNonNegativeValues

      @NotNull @NotNull Collection<T> getNonNegativeValues()
    • getNonPositiveValues

      @NotNull @NotNull Collection<T> getNonPositiveValues()
    • merge

      void merge(DeltaSetTriple<T> triple)
    • clone

      DeltaSetTriple<T> clone(Cloner<T> cloner)
    • isEmpty

      boolean isEmpty()
    • foreach

      void foreach(Processor<T> processor)
      Process each element of every set. This is different from the visitor. Visitor will go deep inside, foreach will remain on the surface.
      Specified by:
      foreach in interface Foreachable<T>
    • simpleAccept

      void simpleAccept(SimpleVisitor<T> visitor)
      Specified by:
      simpleAccept in interface SimpleVisitable<T>
    • transform

      <X> void transform(DeltaSetTriple<X> transformTarget, Transformer<T,X> transformer)
    • debugDumpSets

      void debugDumpSets(StringBuilder sb, Consumer<T> dumper, int indent)
    • toHumanReadableString

      String toHumanReadableString()
    • clear

      default void clear()