java.lang.Object
java.lang.Number
se.kuseman.payloadbuilder.api.execution.Decimal
All Implemented Interfaces:
Serializable, Comparable<Decimal>, ValueVector

public class Decimal extends Number implements Comparable<Decimal>, ValueVector
Wrapper class for data type Column.Type.Decimal.
See Also:
  • Field Details

    • SCALE

      public static final int SCALE
      NOTE! PLB doesn't have support for specifying scaling of decimals (unless created with String/BigDecinal), scale is set to this in factory methods
      See Also:
  • Method Details

    • size

      public int size()
      Description copied from interface: ValueVector
      Return size of vector
      Specified by:
      size in interface ValueVector
    • type

      public ResolvedType type()
      Description copied from interface: ValueVector
      Return type of vector values
      Specified by:
      type in interface ValueVector
    • isNull

      public boolean isNull(int row)
      Description copied from interface: ValueVector
      Return if value at provided row is null
      Specified by:
      isNull in interface ValueVector
    • getDecimal

      public Decimal getDecimal(int row)
      Description copied from interface: ValueVector
      Get decimal value for provided row
      Specified by:
      getDecimal in interface ValueVector
    • processArithmetic

      public Decimal processArithmetic(Decimal other, IArithmeticBinaryExpression.Type type)
      Process provided deicmal to this instance with provided arithmetic type. Returns a new Decimal
    • negate

      public Decimal negate()
      Negate this decimal returning a new instance
    • asBigDecimal

      public BigDecimal asBigDecimal()
      Convert this value as a BigDecimal
    • abs

      public Decimal abs()
      Return the absolute value of this decimal
    • ceiling

      public Decimal ceiling()
      Return ceiling value of this decimal
    • floor

      public Decimal floor()
      Return floor value of this decimal
    • intValue

      public int intValue()
      Specified by:
      intValue in class Number
    • longValue

      public long longValue()
      Specified by:
      longValue in class Number
    • floatValue

      public float floatValue()
      Specified by:
      floatValue in class Number
    • doubleValue

      public double doubleValue()
      Specified by:
      doubleValue in class Number
    • compareTo

      public int compareTo(Decimal o)
      Specified by:
      compareTo in interface Comparable<Decimal>
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • from

      public static Decimal from(Object value)
      Construct a deciaml from provided object. Tries to convert known types like BigDecimal/Strings etc.
    • from

      public static Decimal from(int value)
      Construct a deciaml from provided int
    • from

      public static Decimal from(long value)
      Construct a deciaml from provided long
    • from

      public static Decimal from(float value)
      Construct a deciaml from provided float
    • from

      public static Decimal from(double value)
      Construct a deciaml from provided double