Top Description Methods
org.apache.commons.collections4.sequence

public Interface ReplacementsHandler<T>

Annotations
@FunctionalInterface
Imports
java.util.List

This interface is devoted to handle synchronized replacement sequences.
Since
4.0
See Also
ReplacementsFinder

Method Summary

Modifier and TypeMethod and Description
public void
handleReplacement(int
number of tokens skipped since the last call (i.e. number of tokens that were in both sequences), this number should be strictly positive except on the very first call where it can be zero (if the first object of the two sequences are different)
skipped
,
List<T>
sub-sequence of objects coming from the first sequence
from
,
List<T>
sub-sequence of objects coming from the second sequence
to
)

Handle two synchronized sequences.

Method Detail

handleReplacementback to summary
public void handleReplacement(int skipped, List<T> from, List<T> to)

Handle two synchronized sequences.

This method is called by a ReplacementsFinder instance when it has synchronized two sub-sequences of object arrays being compared, and at least one of the sequences is non-empty. Since the sequences are synchronized, the objects before the two sub-sequences are equals (if they exist). This property also holds for the objects after the two sub-sequences.

The replacement is defined as replacing the from sub-sequence into the to sub-sequence.

Parameters
skipped:int

number of tokens skipped since the last call (i.e. number of tokens that were in both sequences), this number should be strictly positive except on the very first call where it can be zero (if the first object of the two sequences are different)

from:List<T>

sub-sequence of objects coming from the first sequence

to:List<T>

sub-sequence of objects coming from the second sequence