Class LineBreakByteIndexer

java.lang.Object
cool.scx.io.indexer.LineBreakByteIndexer
All Implemented Interfaces:
ByteIndexer

public final class LineBreakByteIndexer extends Object implements ByteIndexer

LineBreakByteIndexer

可同时匹配 \r\n\n .

Version:
0.0.1
Author:
scx567888
  • Constructor Details

    • LineBreakByteIndexer

      public LineBreakByteIndexer()
  • Method Details

    • indexOf

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

      public boolean isEmptyPattern()
      Description copied from interface: ByteIndexer

      是否为空匹配模式

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

      public void reset()
      Description copied from interface: ByteIndexer
      重置匹配状态
      Specified by:
      reset in interface ByteIndexer