Class ByteFunctionHelpers

java.lang.Object
org.apache.drill.exec.expr.fn.impl.ByteFunctionHelpers

public class ByteFunctionHelpers extends Object
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static final int
    compare(DrillBuf left, int lStart, int lEnd, byte[] right, int rStart, int rEnd)
    Helper function to compare a set of bytes in DrillBuf to a ByteArray.
    static final int
    compare(DrillBuf left, int lStart, int lEnd, DrillBuf right, int rStart, int rEnd)
    Helper function to compare a set of bytes in two DrillBuffers.
    static final int
    equal(DrillBuf left, int lStart, int lEnd, DrillBuf right, int rStart, int rEnd)
    Helper function to check for equality of bytes in two DrillBuffers
    static int
    getInteger(byte[] b, int index)
     
    static int
    getInteger(byte[] b, int index, boolean ignoreSign)
     
    static boolean
    getSign(byte[] b)
     
    static void
    setInteger(byte[] b, int index, int value)
     
    static void
    setSign(byte[] b, boolean sign)
     

    Methods inherited from class java.lang.Object

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

    • ByteFunctionHelpers

      public ByteFunctionHelpers()
  • Method Details

    • equal

      public static final int equal(DrillBuf left, int lStart, int lEnd, DrillBuf right, int rStart, int rEnd)
      Helper function to check for equality of bytes in two DrillBuffers
      Parameters:
      left - Left DrillBuf for comparison
      lStart - start offset in the buffer
      lEnd - end offset in the buffer
      right - Right DrillBuf for comparison
      rStart - start offset in the buffer
      rEnd - end offset in the buffer
      Returns:
      1 if left input is greater, -1 if left input is smaller, 0 otherwise
    • compare

      public static final int compare(DrillBuf left, int lStart, int lEnd, DrillBuf right, int rStart, int rEnd)
      Helper function to compare a set of bytes in two DrillBuffers. Function will check data before completing in the case that
      Parameters:
      left - Left DrillBuf to compare
      lStart - start offset in the buffer
      lEnd - end offset in the buffer
      right - Right DrillBuf to compare
      rStart - start offset in the buffer
      rEnd - end offset in the buffer
      Returns:
      1 if left input is greater, -1 if left input is smaller, 0 otherwise
    • compare

      public static final int compare(DrillBuf left, int lStart, int lEnd, byte[] right, int rStart, int rEnd)
      Helper function to compare a set of bytes in DrillBuf to a ByteArray.
      Parameters:
      left - Left DrillBuf for comparison purposes
      lStart - start offset in the buffer
      lEnd - end offset in the buffer
      right - second input to be compared
      rStart - start offset in the byte array
      rEnd - end offset in the byte array
      Returns:
      1 if left input is greater, -1 if left input is smaller, 0 otherwise
    • getInteger

      public static int getInteger(byte[] b, int index)
    • getInteger

      public static int getInteger(byte[] b, int index, boolean ignoreSign)
    • setInteger

      public static void setInteger(byte[] b, int index, int value)
    • setSign

      public static void setSign(byte[] b, boolean sign)
    • getSign

      public static boolean getSign(byte[] b)