Package generic.algorithms
Class ReducingListBasedLcs<T>
- Type Parameters:
T
- the type of the item in the sequence of items
An implementation of the
ReducingLcs
that takes as its input a list of <T>items, where
the list is the 'sequence' being checked for the Longest Common Subsequence.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected int
Return the length of the given sequenceprotected boolean
Returns true if the value of x and y matchCreate a subsequence from the given input sequence.protected T
Return the value at the given 0-based offsetMethods inherited from class generic.algorithms.ReducingLcs
doGetLcs, lengthOfX, lengthOfY, valueOfX, valueOfY
Methods inherited from class generic.algorithms.Lcs
getLcs, getLcs, getSizeLimit, setSizeLimit
-
Constructor Details
-
ReducingListBasedLcs
-
-
Method Details
-
matches
Description copied from class:Lcs
Returns true if the value of x and y match- Overrides:
matches
in classReducingLcs<List<T>,
T> - Parameters:
x
- the x-sequence element of interesty
- the y-sequence element of interest- Returns:
- true if
x
matchesy
; false otherwise
-
reduce
Description copied from class:ReducingLcs
Create a subsequence from the given input sequence.- Specified by:
reduce
in classReducingLcs<List<T>,
T> - Parameters:
i
- the input sequence; 0-based (x or y)start
- the start index; 0-based (inclusive)end
- the end index (exclusive)- Returns:
- the subsequence
-
lengthOf
Description copied from class:ReducingLcs
Return the length of the given sequence- Specified by:
lengthOf
in classReducingLcs<List<T>,
T> - Parameters:
i
- the input sequence (x or y)- Returns:
- the length
-
valueOf
Description copied from class:ReducingLcs
Return the value at the given 0-based offset- Specified by:
valueOf
in classReducingLcs<List<T>,
T> - Parameters:
i
- the input sequence (x or y)offset
- the offset- Returns:
- the value
-