类 LongUtils

java.lang.Object
org.bitlap.roaringbitmap.longlong.LongUtils

public class LongUtils extends Object
  • 字段概要

    字段
    修饰符和类型
    字段
    说明
    static final long
     
  • 构造器概要

    构造器
    构造器
    说明
     
  • 方法概要

    修饰符和类型
    方法
    说明
    static int
    compareHigh(byte[] a, byte[] b)
    compare according to the dictionary order
    static long
    fromBDBytes(byte[] work)
    get the long from the big endian representation bytes
    static byte[]
    highPart(long num)
    get the high 48 bit parts of the input data
    static byte[]
    highPartInPlace(long num, byte[] high48)
    set the high 48 bit parts of the input number into the given byte array
    static long
    initialize a long value with the given fist 32 bit
    static boolean
    isMaxHigh(byte[] high48)
    checks if given high48 is the maximum possible one (e.g. it is the case for -1L, which is the maximum unsigned long)
    static long
    shift the long by left the container size amount so we use the value after have done our steps
    static char
    lowPart(long num)
    get the low 16 bit parts of the input data
    static int
     
    static long
    shift the long right by the container size amount so we can loop across containers by +1 steps
    static byte[]
    toBDBytes(long v)
    to big endian bytes representation
    static long
    toLong(byte[] high, char low)
    reconstruct the long data

    从类继承的方法 java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 字段详细资料

    • MAX_UNSIGNED_INT

      public static final long MAX_UNSIGNED_INT
  • 构造器详细资料

    • LongUtils

      public LongUtils()
  • 方法详细资料

    • highPart

      public static byte[] highPart(long num)
      get the high 48 bit parts of the input data
      参数:
      num - the long number
      返回:
      the high 48 bit
    • lowPart

      public static char lowPart(long num)
      get the low 16 bit parts of the input data
      参数:
      num - the long number
      返回:
      the low 16 bit
    • toLong

      public static long toLong(byte[] high, char low)
      reconstruct the long data
      参数:
      high - the high 48 bit
      low - the low 16 bit
      返回:
      the long data
    • toBDBytes

      public static byte[] toBDBytes(long v)
      to big endian bytes representation
      参数:
      v - a long value
      返回:
      the input long value's big endian byte array representation
    • fromBDBytes

      public static long fromBDBytes(byte[] work)
      get the long from the big endian representation bytes
      参数:
      work - the byte array
      返回:
      the long data
    • compareHigh

      public static int compareHigh(byte[] a, byte[] b)
      compare according to the dictionary order
      参数:
      a - a byte array
      b - another byte array
      返回:
      1 indicates a greater than b,0 indicates equal,-1 indicates a smaller than b
    • initWithFirst4Byte

      public static long initWithFirst4Byte(int v)
      initialize a long value with the given fist 32 bit
      参数:
      v - first 32 bit value
      返回:
      a long value
    • rightShiftHighPart

      public static long rightShiftHighPart(long num)
      shift the long right by the container size amount so we can loop across containers by +1 steps
      参数:
      num - long being treated as unsigned long
      返回:
      value shifted out of value space into container high part
    • leftShiftHighPart

      public static long leftShiftHighPart(long num)
      shift the long by left the container size amount so we use the value after have done our steps
      参数:
      num - uint48 to be shift back into uint64
      返回:
      value shifted out of container high part back into value space
    • maxLowBitAsInteger

      public static int maxLowBitAsInteger()
    • highPartInPlace

      public static byte[] highPartInPlace(long num, byte[] high48)
      set the high 48 bit parts of the input number into the given byte array
      参数:
      num - the long number
      high48 - the byte array
      返回:
      the high 48 bit
    • isMaxHigh

      public static boolean isMaxHigh(byte[] high48)
      checks if given high48 is the maximum possible one (e.g. it is the case for -1L, which is the maximum unsigned long)
      参数:
      high48 - the byte array
      返回:
      true if this the maximum high part