Record Class AbstractContourPlot.ContourPaintState
java.lang.Object
java.lang.Record
org.opentrafficsim.animation.graphs.AbstractContourPlot.ContourPaintState
- Record Components:
data- data as flat arraydx- space granularitydt- time granularitynSpaceSlices- number of slices for spaceinterpolate- whether to interpolategetAvailableTime- 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
ConstructorsConstructorDescriptionContourPaintState(float[] data, double dx, double dt, int nSpaceSlices, boolean interpolate, org.djunits.value.vdouble.scalar.Duration getAvailableTime) Creates an instance of aContourPaintStaterecord class. -
Method Summary
Modifier and TypeMethodDescriptionfloat[]data()Returns the value of thedatarecord component.doubledt()Returns the value of thedtrecord component.doubledx()Returns the value of thedxrecord component.final booleanIndicates whether some other object is "equal to" this one.org.djunits.value.vdouble.scalar.DurationReturns the value of thegetAvailableTimerecord component.intReturns the number of available items.intgetSpaceSlice(double x) Returns the space slice index for the given space value.doublegetSpaceValue(int item) Returns the space slice number of the item.intgetTimeSlice(double t) Returns the time slice index for the given time value.doublegetTimeValue(int item) Returns the time slice number of the item.final inthashCode()Returns a hash code value for this object.booleanReturns the value of theinterpolaterecord component.intReturns the value of thenSpaceSlicesrecord component.final StringtoString()Returns a string representation of this record class.
-
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 aContourPaintStaterecord class.- Parameters:
data- the value for thedatarecord componentdx- the value for thedxrecord componentdt- the value for thedtrecord componentnSpaceSlices- the value for thenSpaceSlicesrecord componentinterpolate- the value for theinterpolaterecord componentgetAvailableTime- the value for thegetAvailableTimerecord 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
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. -
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. -
equals
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 withObjects::equals(Object,Object); primitive components are compared with '=='. -
data
public float[] data()Returns the value of thedatarecord component.- Returns:
- the value of the
datarecord component
-
dx
public double dx()Returns the value of thedxrecord component.- Returns:
- the value of the
dxrecord component
-
dt
public double dt()Returns the value of thedtrecord component.- Returns:
- the value of the
dtrecord component
-
nSpaceSlices
public int nSpaceSlices()Returns the value of thenSpaceSlicesrecord component.- Returns:
- the value of the
nSpaceSlicesrecord component
-
interpolate
public boolean interpolate()Returns the value of theinterpolaterecord component.- Returns:
- the value of the
interpolaterecord component
-
getAvailableTime
public org.djunits.value.vdouble.scalar.Duration getAvailableTime()Returns the value of thegetAvailableTimerecord component.- Returns:
- the value of the
getAvailableTimerecord component
-