Package generic.algorithms
Class LCS<T>
- java.lang.Object
-
- generic.algorithms.LCS<T>
-
- Type Parameters:
T- the type of the objects being compared.
- Direct Known Subclasses:
CodeUnitLCS
public abstract class LCS<T> extends java.lang.ObjectAbstract class for finding the LCS between two sequences of Matchable objects.
-
-
Constructor Summary
Constructors Change Modifier Constructor Description protectedLCS()Convenient constructor for initializing elements in subclasses
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Change Modifier and Type Method Description java.util.List<T>getLCS()java.util.List<T>getLCS(TaskMonitor monitor)NEW protected abstract intlengthOfX()NEW protected abstract intlengthOfY()NEW protected abstract booleanmatches(T x, T y)NEW protected abstract TvalueOfX(int index)NEW protected abstract TvalueOfY(int index)
-
-
-
Method Detail
-
valueOfX NEW
protected abstract T valueOfX(int index)
- Parameters:
index- the position of interest in the X sequence.- Returns:
- the value in the X sequence at
index. Assumes 1-indexing.
-
valueOfY NEW
protected abstract T valueOfY(int index)
- Parameters:
index- the position of interest in the Y sequence.- Returns:
- the value in the Y sequence at
index. Assumes 1-indexing.
-
getLCS
public java.util.List<T> getLCS()
- Returns:
- a
List<T>of elements in the LCS.
-
getLCS
public java.util.List<T> getLCS(TaskMonitor monitor) throws CancelledException
- Throws:
CancelledException
-
-