Interface NaftahTemporalPoint

All Superinterfaces:
NaftahTemporal
All Known Implementing Classes:
NaftahDate, NaftahDateTime, NaftahTime

public sealed interface NaftahTemporalPoint extends NaftahTemporal permits NaftahTime, NaftahDate, NaftahDateTime
Marker interface representing a Naftah temporal point.

A temporal point represents a specific position on the time-line (such as a date, time, or date-time) with an Naftah textual representation.

This sealed interface provides a common abstraction for all Naftah-aware temporal points and allows access to their underlying Temporal representation.

The following implementations are permitted:

Author:
Chakib Daii
  • Method Summary

    Modifier and Type
    Method
    Description
    default boolean
    greaterThan(NaftahTemporalPoint otherNaftahTemporalPoint)
    Determines whether this temporal point occurs after the given temporal point.
    default boolean
    greaterThanEquals(NaftahTemporalPoint otherNaftahTemporalPoint)
    Determines whether this temporal point occurs after or at the same instant as the given temporal point.
    default boolean
    isEquals(NaftahTemporalPoint otherNaftahTemporalPoint)
    Determines whether this temporal point represents the same instant as the given temporal point.
    default boolean
    lessThan(NaftahTemporalPoint otherNaftahTemporalPoint)
    Determines whether this temporal point occurs before the given temporal point.
    default boolean
    lessThanEquals(NaftahTemporalPoint otherNaftahTemporalPoint)
    Determines whether this temporal point occurs before or at the same instant as the given temporal point.
    minus(NaftahTemporalAmount naftahTemporalAmount)
    Returns a temporal point obtained by subtracting the given Naftah temporal amount from this temporal point.
    default boolean
    notEquals(NaftahTemporalPoint otherNaftahTemporalPoint)
    Determines whether this temporal point does not represent the same instant as the given temporal point.
    plus(NaftahTemporalAmount naftahTemporalAmount)
    Returns a temporal point obtained by adding the given Naftah temporal amount to this temporal point.
    Returns the underlying Temporal representation of this temporal point.
  • Method Details

    • temporal

      Temporal temporal()
      Returns the underlying Temporal representation of this temporal point.
      Returns:
      the temporal representation
    • plus

      NaftahTemporalPoint plus(NaftahTemporalAmount naftahTemporalAmount)
      Returns a temporal point obtained by adding the given Naftah temporal amount to this temporal point.
      Parameters:
      naftahTemporalAmount - the amount to add
      Returns:
      a new NaftahTemporalPoint with the amount added
    • minus

      NaftahTemporalPoint minus(NaftahTemporalAmount naftahTemporalAmount)
      Returns a temporal point obtained by subtracting the given Naftah temporal amount from this temporal point.
      Parameters:
      naftahTemporalAmount - the amount to subtract
      Returns:
      a new NaftahTemporalPoint with the amount subtracted
    • isEquals

      default boolean isEquals(NaftahTemporalPoint otherNaftahTemporalPoint)
      Determines whether this temporal point represents the same instant as the given temporal point.
      Parameters:
      otherNaftahTemporalPoint - the temporal point to compare with
      Returns:
      true if both temporal points represent the same instant; false otherwise
    • notEquals

      default boolean notEquals(NaftahTemporalPoint otherNaftahTemporalPoint)
      Determines whether this temporal point does not represent the same instant as the given temporal point.
      Parameters:
      otherNaftahTemporalPoint - the temporal point to compare with
      Returns:
      true if the temporal points are not equal; false otherwise
    • greaterThan

      default boolean greaterThan(NaftahTemporalPoint otherNaftahTemporalPoint)
      Determines whether this temporal point occurs after the given temporal point.
      Parameters:
      otherNaftahTemporalPoint - the temporal point to compare with
      Returns:
      true if this temporal point is after the given one; false otherwise
    • greaterThanEquals

      default boolean greaterThanEquals(NaftahTemporalPoint otherNaftahTemporalPoint)
      Determines whether this temporal point occurs after or at the same instant as the given temporal point.
      Parameters:
      otherNaftahTemporalPoint - the temporal point to compare with
      Returns:
      true if this temporal point is after or equal to the given one; false otherwise
    • lessThan

      default boolean lessThan(NaftahTemporalPoint otherNaftahTemporalPoint)
      Determines whether this temporal point occurs before the given temporal point.
      Parameters:
      otherNaftahTemporalPoint - the temporal point to compare with
      Returns:
      true if this temporal point is before the given one; false otherwise
    • lessThanEquals

      default boolean lessThanEquals(NaftahTemporalPoint otherNaftahTemporalPoint)
      Determines whether this temporal point occurs before or at the same instant as the given temporal point.
      Parameters:
      otherNaftahTemporalPoint - the temporal point to compare with
      Returns:
      true if this temporal point is before or equal to the given one; false otherwise