Class MinLengthCharSequenceMatcher

java.lang.Object
ghidra.util.ascii.MinLengthCharSequenceMatcher

public class MinLengthCharSequenceMatcher extends Object
Instances of this class will find sequences of characters that are in the given char set and of a minimum length. Characters a fed one at a time into this object. Adding a char may trigger the discovery of a sequence if the char is a 0 or not in the char set and we already have seen a sequence of included chars at least as long as the minimum length.
  • Constructor Details

    • MinLengthCharSequenceMatcher

      public MinLengthCharSequenceMatcher(int minimumSequenceLength, CharSetRecognizer charSet, int alignment)
  • Method Details

    • addChar

      public boolean addChar(int c)
      Adds a character to this sequence matcher.
      Parameters:
      c - the character to add.
      Returns:
      a Sequence if the added char triggered an end of a valid sequence, otherwise null.
    • endSequence

      public boolean endSequence()
      Indicates there are no more contiguous chars to add to this matcher. If a minimum or more number of included chars have been seen before this call, then a sequence is returned.
      Returns:
      a Sequence if there was a sequence of chars >= the min length just before this call.
    • reset

      public void reset()
    • getSequence

      public Sequence getSequence()