Interface ByteIndexer

All Known Implementing Classes:
BitMaskByteIndexer, KMPByteIndexer, LineBreakByteIndexer, SingleByteIndexer

public interface ByteIndexer

ByteIndexer

支持跨 chunk 匹配, 有状态的 索引匹配器, 可连续调用 indexOf.

Version:
0.0.1
Author:
scx567888
  • Method Summary

    Modifier and Type
    Method
    Description
    • 匹配成功需重置状态, 以便能够直接进行下次匹配.
    boolean
    是否为空匹配模式
    void
    重置匹配状态
  • Method Details

    • indexOf

      • 匹配成功需重置状态, 以便能够直接进行下次匹配.
      • 可以不处理 空匹配模式 的边界情况 (上层会根据 patternLength == 0 直接走快速路径), 但要保证 patternLength 实现正确.
    • isEmptyPattern

      boolean isEmptyPattern()

      是否为空匹配模式

      • 对于固定长度模式串: 返回 是否是空模式串
      • 对于无法静态确定的可变长度模式串 (如正则), 返回 false.
    • reset

      void reset()
      重置匹配状态