Class AbstractDelta<T>

  • All Implemented Interfaces:
    java.io.Serializable
    Direct Known Subclasses:
    ChangeDelta, DeleteDelta, EqualDelta, InsertDelta

    public abstract class AbstractDelta<T>
    extends java.lang.Object
    implements java.io.Serializable
    Abstract delta between a source and a target.
    See Also:
    Serialized Form
    • Field Detail

      • source

        private final Chunk<T> source
      • target

        private final Chunk<T> target
    • Method Detail

      • getSource

        public Chunk<T> getSource()
      • getTarget

        public Chunk<T> getTarget()
      • restore

        protected abstract void restore​(java.util.List<T> target)
      • applyFuzzyToAt

        protected void applyFuzzyToAt​(java.util.List<T> target,
                                      int fuzz,
                                      int position)
                               throws PatchFailedException
        Apply patch fuzzy.
        Parameters:
        target - the list this patch will be applied to
        fuzz - the number of elements to ignore before/after the patched elements
        position - the position this patch will be applied to. ignores source.getPosition()
        Throws:
        PatchFailedException
        See Also:
        Description of Fuzzy Patch for more information.
      • withChunks

        public abstract AbstractDelta<T> withChunks​(Chunk<T> original,
                                                    Chunk<T> revised)
        Create a new delta of the actual instance with customized chunk data.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object