Interface TNumber

All Known Subinterfaces:
TFloat, TInt
All Known Implementing Classes:
TFloatInst, TFloatSeq, TFloatSeqSet, TIntInst, TIntSeq, TIntSeqSet

public interface TNumber
Base interface that encompasses the Temporal float and Temporal integer interfaces.
Author:
ARIJIT SAMAL
  • Method Summary

    Modifier and Type
    Method
    Description
    default TNumber
    _add(Object other)
    Returns a new temporal object with the values of `self` plus `other`.
    default TNumber
    _mul(Object other)
    Returns a new temporal object with the values of `self` multiplied by `other`.
    default TNumber
    _radd(Object other)
    Returns a new temporal object with the values of `self` plus `other`.
    default TNumber
    _rmul(Object other)
    Returns a new temporal object with the values of `self` multiplied by `other`.
    default TNumber
    _rsub(Object other)
    Returns a new temporal object with the values of `other` minus `self`.
    default TNumber
    Returns a new temporal object with the values of `other` divided by `self`.
    default TNumber
    _sub(Object other)
    Returns a new temporal object with the values of `self` minus `other`.
    default TNumber
    Returns a new temporal object with the values of `self` divided by `other`.
    default TNumber
    abs()
    Returns the absolute value of "this".
    default TNumber
    add(Object other)
    Returns a new temporal object with the values of "this" plus "other".
    default TNumber
    at(Object other)
    Returns a new temporal object with the values of "this" restricted to the value or time "other".
    default TBox
    Returns the bounding box of "this".
    private jnr.ffi.Pointer
    createEmptyPointerArray(jnr.ffi.Runtime runtime, int size)
    Splits `self` into fragments with respect to value buckets Args: start: Start value of the first value bucket.
    default TNumber
    Returns the value difference between consecutive instants of "this".
    default TFloat
    Returns the temporal distance between "this" and "other".
    default TNumber
    div(Object other)
    Returns a new temporal object with the values of "this" divided by "other".
     
    jnr.ffi.Pointer
     
     
    default float
    Returns the integral of "this".
    default boolean
    Returns whether the bounding box of "this" is left to the bounding box of "other".
    default boolean
    Returns whether the bounding box of "this" is over or left to the bounding box of "other".
    default boolean
    Returns whether the bounding box of "this" is over or right to the bounding box of "other".
    default boolean
    Returns whether the bounding box of "this" is right to the bounding box of "other".
    default TNumber
    minus(Object other)
    Returns a new temporal object with the values of "this" restricted to the complement of the value or time "other".
    default TNumber
    mul(Object other)
    Returns a new temporal object with the values of "this" multiplied by "other".
    default float
    Returns the nearest approach distance between "this" and "other".
    default TNumber
    radd(Object other)
    Returns a new temporal object with the values of "this" plus "other".
    default TNumber
    rdiv(Object other)
    Returns a new temporal object with the values of "this" divided by "other".
    default TNumber
    rmul(Object other)
    Returns a new temporal object with the values of "this" multiplied "other".
    default TNumber
    rsub(Object other)
    Returns a new temporal object with the values of "this" minus "other".
    default TNumber
    Returns a new :class:`TNumber` scaled so the value dimension has width ``width``.
    default TNumber
    Returns a new :class:`TNumber` with the value dimension shifted by ``shift`` and scaled so the value dimension has width ``width``.
    default TNumber
    Returns a new :class:`TNumber` with the value dimension shifted by ``delta``.
    default TNumber
    sub(Object other)
    Returns a new temporal object with the values of "this" minus "other".
    default float
    Returns the time weighted average of "this".
    default List<TNumber>
    value_split(int size, int start)
     
    default List<TNumber>
    value_time_split(Object duration, int value_size, int value_start, Object time_start)
    Splits `self` into fragments with respect to value and tstzspan buckets.
  • Method Details

    • getNumberInner

      jnr.ffi.Pointer getNumberInner()
    • getCustomType

      String getCustomType()
    • getTemporalType

      TemporalType getTemporalType()
    • bounding_tbox

      default TBox bounding_tbox() throws SQLException
      Returns the bounding box of "this".

      MEOS Functions:

    • tbox_tnumber
    • Returns:
      The bounding box of "this".
      Throws:
      SQLException
    • integral

      default float integral()
      Returns the integral of "this".

      MEOS Function:

    • tnumber_integral
    • Returns:
      The integral of "this".
    • time_weighted_average

      default float time_weighted_average()
      Returns the time weighted average of "this".

      MEOS Function:

    • tnumber_twavg
    • Returns:
      The time weighted average of "this".
    • shift_value

      default TNumber shift_value(Object delta) throws Exception
      Returns a new :class:`TNumber` with the value dimension shifted by ``delta``. Args: delta: value to shift MEOS Functions: tint_shift_value, tfloat_shift_value
      Throws:
      Exception
    • scale_value

      default TNumber scale_value(Object width) throws Exception
      Returns a new :class:`TNumber` scaled so the value dimension has width ``width``. Args: width: value representing the width of the new temporal number MEOS Functions: tint_scale_value, tfloat_scale_value
      Throws:
      Exception
    • shift_scale_value

      default TNumber shift_scale_value(Object shift, Object width) throws Exception
      Returns a new :class:`TNumber` with the value dimension shifted by ``shift`` and scaled so the value dimension has width ``width``. Args: shift: value to shift width: value representing the width of the new temporal number MEOS Functions: tint_shift_scale_value, tfloat_shift_scale_value
      Throws:
      Exception
    • at

      default TNumber at(Object other) throws OperationNotSupportedException
      Returns a new temporal object with the values of "this" restricted to the value or time "other".

      MEOS Functions:

      • temporal_at_values
      • tnumber_at_span
      • tnumber_at_spanset
      • tnumber_at_tbox
      • temporal_at_timestamp
      • temporal_at_timestampset
      • temporal_at_period
      • temporal_at_periodset
      Parameters:
      other - A time or value object to restrict the values of "this" to.
      Returns:
      A new temporal object of the same subtype as "this".
      Throws:
      OperationNotSupportedException
    • minus

      default TNumber minus(Object other) throws OperationNotSupportedException
      Returns a new temporal object with the values of "this" restricted to the complement of the value or time "other".

      MEOS Functions:

      • temporal_minus_values
      • tnumber_minus_span
      • tnumber_minus_spanset
      • tnumber_minus_tbox
      • temporal_minus_timestamp
      • temporal_minus_timestampset
      • temporal_minus_period
      • temporal_minus_periodset
      Parameters:
      other - A time or value object to restrict the values of "this" to * the complement of.
      Returns:
      A new temporal object of the same subtype as "this".
      Throws:
      OperationNotSupportedException
    • is_left

      default boolean is_left(TemporalObject other) throws SQLException
      Returns whether the bounding box of "this" is left to the bounding box of "other".

      Parameters:
      other - A box or a temporal object to compare to "this".
      Returns:
      True if left, False otherwise.
      Throws:
      SQLException
    • is_over_or_left

      default boolean is_over_or_left(TemporalObject other) throws SQLException
      Returns whether the bounding box of "this" is over or left to the bounding box of "other".

      Parameters:
      other - A box or a temporal object to compare to "this".
      Returns:
      True if over or left, False otherwise.
      Throws:
      SQLException
    • is_right

      default boolean is_right(TemporalObject other) throws SQLException
      Returns whether the bounding box of "this" is right to the bounding box of "other".

      Parameters:
      other - A box or a temporal object to compare to "this".
      Returns:
      True if right, False otherwise.
      Throws:
      SQLException
    • is_over_or_right

      default boolean is_over_or_right(TemporalObject other) throws SQLException
      Returns whether the bounding box of "this" is over or right to the bounding box of "other".

      Parameters:
      other - A box or a temporal object to compare to "this".
      Returns:
      True if over or right, False otherwise.
      Throws:
      SQLException
    • add

      default TNumber add(Object other) throws OperationNotSupportedException
      Returns a new temporal object with the values of "this" plus "other".

      MEOS FUNCTIONS:

      • add_tin_int
      • add_tfloat_float
      • add_tnumber_tnumber
      Parameters:
      other - A Integer, Float or TNumber to add * to "this".
      Returns:
      A new temporal object of the same subtype as "this".
      Throws:
      OperationNotSupportedException
    • radd

      default TNumber radd(Object other) throws OperationNotSupportedException
      Returns a new temporal object with the values of "this" plus "other".

      MEOS Functions:

      • add_int_tint
      • add_float_tfloat
      Parameters:
      other - A Integer or Float to add to "this".
      Returns:
      A new temporal object of the same subtype as "this".
      Throws:
      OperationNotSupportedException
    • sub

      default TNumber sub(Object other) throws OperationNotSupportedException
      Returns a new temporal object with the values of "this" minus "other".

      MEOS Functions:

      • sub_tint_int
      • sub_tfloat_float
      • sub_tnumber_tnumber
      Parameters:
      other - A Integer, Float or TNumber to add * * to "this".
      Returns:
      A new temporal object of the same subtype as "this".
      Throws:
      OperationNotSupportedException
    • rsub

      default TNumber rsub(Object other) throws OperationNotSupportedException
      Returns a new temporal object with the values of "this" minus "other".

      MEOS Functions:

      • sub_int_tint
      • sub_float_tfloat
      Parameters:
      other - A Integer or Float to add to "this".
      Returns:
      A new temporal object of the same subtype as "this".
      Throws:
      OperationNotSupportedException
    • mul

      default TNumber mul(Object other) throws OperationNotSupportedException
      Returns a new temporal object with the values of "this" multiplied by "other".

      MEOS Functions:

      • mult_tint_int
      • mult_tfloat_float
      • mult_tnumber_tnumber
      Parameters:
      other - A Integer, Float or TNumber to add * * to "this".
      Returns:
      A new temporal object of the same subtype as "this".
      Throws:
      OperationNotSupportedException
    • rmul

      default TNumber rmul(Object other) throws OperationNotSupportedException
      Returns a new temporal object with the values of "this" multiplied "other".

      MEOS Functions:

      • mult_int_tint
      • mult_float_tfloat
      Parameters:
      other - A Integer or Float to add to "this".
      Returns:
      A new temporal object of the same subtype as "this".
      Throws:
      OperationNotSupportedException
    • div

      default TNumber div(Object other) throws OperationNotSupportedException
      Returns a new temporal object with the values of "this" divided by "other".

      MEOS Functions:

      • div_tint_int
      • div_tfloat_float
      • div_tnumber_tnumber
      Parameters:
      other - A Integer, Float or TNumber to add * * to "this".
      Returns:
      A new temporal object of the same subtype as "this".
      Throws:
      OperationNotSupportedException
    • rdiv

      default TNumber rdiv(Object other) throws OperationNotSupportedException
      Returns a new temporal object with the values of "this" divided by "other".

      MEOS Functions:

      • div_int_tint
      • div_float_tfloat
      Parameters:
      other - A Integer or Float to add to "this".
      Returns:
      A new temporal object of the same subtype as "this".
      Throws:
      OperationNotSupportedException
    • _add

      default TNumber _add(Object other) throws OperationNotSupportedException
      Returns a new temporal object with the values of `self` plus `other`. Args: other: A :class:`int`, :class:`float` or :class:`TNumber` to add to `self`. Returns: A new temporal object of the same subtype as `self`.
      Throws:
      OperationNotSupportedException
    • _radd

      default TNumber _radd(Object other) throws OperationNotSupportedException
      Returns a new temporal object with the values of `self` plus `other`. Args: other: A :class:`int` or :class:`float` to add to `self`. Returns: A new temporal object of the same subtype as `self`. MEOS Functions: add_int_tint, add_float_tfloat
      Throws:
      OperationNotSupportedException
    • _sub

      default TNumber _sub(Object other) throws OperationNotSupportedException
      Returns a new temporal object with the values of `self` minus `other`. Args: other: A :class:`int`, :class:`float` or :class:`TNumber` to subtract from `self`. Returns: A new temporal object of the same subtype as `self`. MEOS Functions: sub_tint_int, sub_tfloat_float, sub_tnumber_tnumber
      Throws:
      OperationNotSupportedException
    • _rsub

      default TNumber _rsub(Object other) throws OperationNotSupportedException
      Returns a new temporal object with the values of `other` minus `self`. Args: other: A :class:`int` or :class:`float` to subtract `self` to. Returns: A new temporal object of the same subtype as `self`. MEOS Functions: sub_int_tint, sub_float_tfloat
      Throws:
      OperationNotSupportedException
    • _mul

      default TNumber _mul(Object other) throws OperationNotSupportedException
      Returns a new temporal object with the values of `self` multiplied by `other`. Args: other: A :class:`int`, :class:`float` or :class:`TNumber` to multiply `self` by. Returns: A new temporal object of the same subtype as `self`. MEOS Functions: mult_tint_int, mult_tfloat_float, mult_tnumber_tnumber
      Throws:
      OperationNotSupportedException
    • _rmul

      default TNumber _rmul(Object other) throws OperationNotSupportedException
      Returns a new temporal object with the values of `self` multiplied by `other`. Args: other: A :class:`int` or :class:`float` to multiply by `self`. Returns: A new temporal object of the same subtype as `self`. MEOS Functions: mult_int_tint, mult_float_tfloat
      Throws:
      OperationNotSupportedException
    • _trueDiv

      default TNumber _trueDiv(Object other) throws OperationNotSupportedException
      Returns a new temporal object with the values of `self` divided by `other`. Args: other: A :class:`int`, :class:`float` or :class:`TNumber` to divide `self` by. Returns: A new temporal object of the same subtype as `self`. MEOS Functions: div_tint_int, div_tfloat_float, div_tnumber_tnumber
      Throws:
      OperationNotSupportedException
    • _rTrueDiv

      default TNumber _rTrueDiv(Object other) throws OperationNotSupportedException
      Returns a new temporal object with the values of `other` divided by `self`. Args: other: A :class:`int` or :class:`float` to divide by `self`. Returns: A new temporal object of the same subtype as `self`. MEOS Functions: div_int_tint, div_float_tfloat
      Throws:
      OperationNotSupportedException
    • abs

      default TNumber abs()
      Returns the absolute value of "this".

      MEOS Functions:

    • tnumber_abs
    • Returns:
      A new TNumber instance.
    • delta_value

      default TNumber delta_value()
      Returns the value difference between consecutive instants of "this".

      MEOS Functions:

    • tnumber_delta_value
    • Returns:
      A new TNumber instance.
    • distance

      default TFloat distance(Object other) throws OperationNotSupportedException
      Returns the temporal distance between "this" and "other".

      MEOS Functions:

      • distance_tfloat_float
      • distance_tnumber_tnumber
      Parameters:
      other - A Integer, Float or TNumber to * compare to "this".
      Returns:
      A TFloat with the distance between "this" and "other".
      Throws:
      OperationNotSupportedException
    • nearest_approach_distance

      default float nearest_approach_distance(Object other) throws OperationNotSupportedException
      Returns the nearest approach distance between "this" and "other".

      MEOS Functions: nad_tfloat_float nad_tfloat_tfloat nad_tnumber_tbox

      Parameters:
      other - A Integer, Float or TNumber or TBoxto * * compare to "this".
      Returns:
      A Float with the nearest approach distance between "this" * and "other".
      Throws:
      OperationNotSupportedException
    • createEmptyPointerArray

      private jnr.ffi.Pointer createEmptyPointerArray(jnr.ffi.Runtime runtime, int size)
      Splits `self` into fragments with respect to value buckets Args: start: Start value of the first value bucket. size: Size of the value buckets. Returns: A list of temporal ints. MEOS Functions: tint_value_split
    • value_split

      default List<TNumber> value_split(int size, int start)
    • value_time_split

      default List<TNumber> value_time_split(Object duration, int value_size, int value_start, Object time_start)
      Splits `self` into fragments with respect to value and tstzspan buckets. Args: value_size: Size of the value buckets. duration: Duration of the tstzspan buckets. value_start: Start value of the first value bucket. If None, the start value used by default is 0 time_start: Start time of the first tstzspan bucket. If None, the start time used by default is Monday, January 3, 2000. Returns: A list of temporal integers. MEOS Functions: