Class StringReducingLcs


public class StringReducingLcs NEW extends ReducingLcs<String,Character>
A reducing LCS that works on Strings.
  • Constructor Details

    • StringReducingLcs

      public StringReducingLcs(String x, String y)
  • Method Details

    • reduce

      protected String reduce(String input, int start, int end)
      Description copied from class: ReducingLcs
      Create a subsequence from the given input sequence.
      Specified by:
      reduce in class ReducingLcs<String,Character>
      Parameters:
      input - the input sequence; 0-based (x or y)
      start - the start index; 0-based (inclusive)
      end - the end index (exclusive)
      Returns:
      the subsequence
    • lengthOf

      protected int lengthOf(String s)
      Description copied from class: ReducingLcs
      Return the length of the given sequence
      Specified by:
      lengthOf in class ReducingLcs<String,Character>
      Parameters:
      s - the input sequence (x or y)
      Returns:
      the length
    • valueOf

      protected Character valueOf(String s, int offset)
      Description copied from class: ReducingLcs
      Return the value at the given 0-based offset
      Specified by:
      valueOf in class ReducingLcs<String,Character>
      Parameters:
      s - the input sequence (x or y)
      offset - the offset
      Returns:
      the value