Record Class AbstractContourPlot.ContourPaintState

java.lang.Object
java.lang.Record
org.opentrafficsim.animation.graphs.AbstractContourPlot.ContourPaintState
Record Components:
data - data as flat array
dx - space granularity
dt - time granularity
nSpaceSlices - number of slices for space
interpolate - whether to interpolate
getAvailableTime - available time
Enclosing class:
AbstractContourPlot<Z extends Number>

public static record AbstractContourPlot.ContourPaintState(float[] data, double dx, double dt, int nSpaceSlices, boolean interpolate, org.djunits.value.vdouble.scalar.Duration getAvailableTime) extends Record
Paint state for contour plots.
  • Constructor Summary

    Constructors
    Constructor
    Description
    ContourPaintState(float[] data, double dx, double dt, int nSpaceSlices, boolean interpolate, org.djunits.value.vdouble.scalar.Duration getAvailableTime)
    Creates an instance of a ContourPaintState record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    float[]
    Returns the value of the data record component.
    double
    dt()
    Returns the value of the dt record component.
    double
    dx()
    Returns the value of the dx record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    org.djunits.value.vdouble.scalar.Duration
    Returns the value of the getAvailableTime record component.
    int
    Returns the number of available items.
    int
    getSpaceSlice(double x)
    Returns the space slice index for the given space value.
    double
    getSpaceValue(int item)
    Returns the space slice number of the item.
    int
    getTimeSlice(double t)
    Returns the time slice index for the given time value.
    double
    getTimeValue(int item)
    Returns the time slice number of the item.
    final int
    Returns a hash code value for this object.
    boolean
    Returns the value of the interpolate record component.
    int
    Returns the value of the nSpaceSlices record component.
    final String
    Returns a string representation of this record class.

    Methods inherited from class java.lang.Object

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

    • ContourPaintState

      public ContourPaintState(float[] data, double dx, double dt, int nSpaceSlices, boolean interpolate, org.djunits.value.vdouble.scalar.Duration getAvailableTime)
      Creates an instance of a ContourPaintState record class.
      Parameters:
      data - the value for the data record component
      dx - the value for the dx record component
      dt - the value for the dt record component
      nSpaceSlices - the value for the nSpaceSlices record component
      interpolate - the value for the interpolate record component
      getAvailableTime - the value for the getAvailableTime record component
  • Method Details

    • getItemCount

      public int getItemCount()
      Returns the number of available items.
      Returns:
      number of available items
    • getTimeValue

      public double getTimeValue(int item)
      Returns the time slice number of the item.
      Parameters:
      item - item number
      Returns:
      time slice number of the item
    • getSpaceValue

      public double getSpaceValue(int item)
      Returns the space slice number of the item.
      Parameters:
      item - item number
      Returns:
      space slice number of the item
    • getTimeSlice

      public int getTimeSlice(double t)
      Returns the time slice index for the given time value.
      Parameters:
      t - time value
      Returns:
      time slice index
    • getSpaceSlice

      public int getSpaceSlice(double x)
      Returns the space slice index for the given space value.
      Parameters:
      x - space value
      Returns:
      space slice index
    • 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. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      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.
    • data

      public float[] data()
      Returns the value of the data record component.
      Returns:
      the value of the data record component
    • dx

      public double dx()
      Returns the value of the dx record component.
      Returns:
      the value of the dx record component
    • dt

      public double dt()
      Returns the value of the dt record component.
      Returns:
      the value of the dt record component
    • nSpaceSlices

      public int nSpaceSlices()
      Returns the value of the nSpaceSlices record component.
      Returns:
      the value of the nSpaceSlices record component
    • interpolate

      public boolean interpolate()
      Returns the value of the interpolate record component.
      Returns:
      the value of the interpolate record component
    • getAvailableTime

      public org.djunits.value.vdouble.scalar.Duration getAvailableTime()
      Returns the value of the getAvailableTime record component.
      Returns:
      the value of the getAvailableTime record component