Class SingleByteIndexer

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

public final class SingleByteIndexer extends Object implements ByteIndexer
SingleByteIndexer
Version:
0.0.1
Author:
scx567888
  • Constructor Details

    • SingleByteIndexer

      public SingleByteIndexer(byte b)
  • Method Details

    • indexOf

      public int indexOf(ByteChunk chunk)
      Description copied from interface: ByteIndexer
      支持跨 chunk 的回溯匹配, 因此返回值可能为负数 若未匹配到 请返回 NO_MATCH 若当前匹配模式为空, 永远返回 0 (即使 ByteChunk 为空)
      Specified by:
      indexOf in interface ByteIndexer
      Parameters:
      chunk - chunk
      Returns:
      匹配的索引位置
    • isEmptyPattern

      public boolean isEmptyPattern()
      Description copied from interface: ByteIndexer
      是否为空匹配模式 (匹配空 ByteChunk 恒成立)
      Specified by:
      isEmptyPattern in interface ByteIndexer