Record Class Area

java.lang.Object
java.lang.Record
by.andd3dfx.math.space.Area
Record Components:
x - spatial interval defining the domain boundaries and discretization
t - temporal interval defining the time range and discretization

public record Area(Interval x, Interval t) extends Record
Represents a two-dimensional space-time domain for partial differential equations. This record combines spatial and temporal intervals to define the computational domain where the PDE is solved. It provides methods for coordinate-to-index and index-to-coordinate conversions in both spatial and temporal dimensions.
See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates an instance of a Area record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    t()
    Returns the value of the t record component.
    int
    ti(double time)
    Returns the temporal index closest to the specified time value.
    double
    Returns the left boundary of the temporal domain.
    int
    tn()
    Returns the number of points in the temporal domain.
    final String
    Returns a string representation of this record class.
    double
    Returns the right boundary of the temporal domain.
    double
    tx(int i)
    Returns the time value at the specified temporal index.
    x()
    Returns the value of the x record component.
    int
    xi(double x)
    Returns the spatial index closest to the specified coordinate.
    double
    Returns the left boundary of the spatial domain.
    int
    xn()
    Returns the number of points in the spatial domain.
    double
    Returns the right boundary of the spatial domain.
    double
    xx(int i)
    Returns the spatial coordinate at the specified spatial index.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • Area

      public Area(Interval x, Interval t)
      Creates an instance of a Area record class.
      Parameters:
      x - the value for the x record component
      t - the value for the t record component
  • Method Details

    • tLeft

      public double tLeft()
      Returns the left boundary of the temporal domain.
      Returns:
      left boundary of the time interval
    • tRight

      public double tRight()
      Returns the right boundary of the temporal domain.
      Returns:
      right boundary of the time interval
    • tn

      public int tn()
      Returns the number of points in the temporal domain.
      Returns:
      number of time points
    • tx

      public double tx(int i)
      Returns the time value at the specified temporal index.
      Parameters:
      i - temporal index (0 <= i <= tn)
      Returns:
      time value at index i
      Throws:
      IllegalArgumentException - if i < 0 or i > tn
    • ti

      public int ti(double time)
      Returns the temporal index closest to the specified time value.
      Parameters:
      time - time value (tLeft <= time <= tRight)
      Returns:
      index of the closest time point
      Throws:
      IllegalArgumentException - if time < tLeft or time > tRight
    • xLeft

      public double xLeft()
      Returns the left boundary of the spatial domain.
      Returns:
      left boundary of the spatial interval
    • xRight

      public double xRight()
      Returns the right boundary of the spatial domain.
      Returns:
      right boundary of the spatial interval
    • xn

      public int xn()
      Returns the number of points in the spatial domain.
      Returns:
      number of spatial points
    • xx

      public double xx(int i)
      Returns the spatial coordinate at the specified spatial index.
      Parameters:
      i - spatial index (0 <= i <= xn)
      Returns:
      spatial coordinate at index i
      Throws:
      IllegalArgumentException - if i < 0 or i > xn
    • xi

      public int xi(double x)
      Returns the spatial index closest to the specified coordinate.
      Parameters:
      x - spatial coordinate (xLeft <= x <= xRight)
      Returns:
      index of the closest spatial point
      Throws:
      IllegalArgumentException - if x < xLeft or x > xRight
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • x

      public Interval x()
      Returns the value of the x record component.
      Returns:
      the value of the x record component
    • t

      public Interval t()
      Returns the value of the t record component.
      Returns:
      the value of the t record component