Class SimpleByteIndexer

java.lang.Object
cool.scx.bytes.indexer.SimpleByteIndexer
All Implemented Interfaces:
ByteIndexer

public class SimpleByteIndexer extends Object implements ByteIndexer
单字节查找器
Version:
0.0.1
Author:
scx567888
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    注意此方法支持回溯匹配 所以返回值可能出现负数 为了性能考虑 不使用异常来中断 当真正 未找到时 返回 Integer.MIN_VALUE 此方法会循环调用 所以注意内部处理 建议每次都重新创建

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • SimpleByteIndexer

      public SimpleByteIndexer(byte b)
  • Method Details

    • indexOf

      public int indexOf(ByteChunk chunk)
      Description copied from interface: ByteIndexer
      注意此方法支持回溯匹配 所以返回值可能出现负数 为了性能考虑 不使用异常来中断 当真正 未找到时 返回 Integer.MIN_VALUE 此方法会循环调用 所以注意内部处理 建议每次都重新创建
      Specified by:
      indexOf in interface ByteIndexer
      Parameters:
      chunk - chunk
      Returns:
      l 索引值 (可能为负数)