Package io.keikai.axyra.sheets.content
Record Class Trendline
java.lang.Object
java.lang.Record
io.keikai.axyra.sheets.content.Trendline
public record Trendline(String kind, double forward, double backward, int order, int period, boolean showEquation, boolean showRSquared)
extends Record
A series trendline (ECMA-376 §21.2.2.210).
kind is one of
linear | exp | log | movingAvg | poly | power; order
applies to poly, period to movingAvg.
Trendlines are honored by the in-memory model and the chart renderer
(Sheet.renderChartToPng), and persist to the saved workbook
(re-emitted as <c:trendline> per ECMA-376 §21.2.2.211).
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondoublebackward()Returns the value of thebackwardrecord component.final booleanIndicates whether some other object is "equal to" this one.doubleforward()Returns the value of theforwardrecord component.final inthashCode()Returns a hash code value for this object.kind()Returns the value of thekindrecord component.static Trendlinelinear()A plain linear trendline.static TrendlinemovingAverage(int period) A moving-average trendline overperiodpoints.intorder()Returns the value of theorderrecord component.intperiod()Returns the value of theperiodrecord component.static Trendlinepolynomial(int order) A polynomial trendline of the given order.booleanReturns the value of theshowEquationrecord component.booleanReturns the value of theshowRSquaredrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Trendline
public Trendline(String kind, double forward, double backward, int order, int period, boolean showEquation, boolean showRSquared) Creates an instance of aTrendlinerecord class.- Parameters:
kind- the value for thekindrecord componentforward- the value for theforwardrecord componentbackward- the value for thebackwardrecord componentorder- the value for theorderrecord componentperiod- the value for theperiodrecord componentshowEquation- the value for theshowEquationrecord componentshowRSquared- the value for theshowRSquaredrecord component
-
-
Method Details
-
linear
A plain linear trendline. -
movingAverage
A moving-average trendline overperiodpoints. -
polynomial
A polynomial trendline of the given order. -
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 '=='. -
kind
Returns the value of thekindrecord component.- Returns:
- the value of the
kindrecord component
-
forward
public double forward()Returns the value of theforwardrecord component.- Returns:
- the value of the
forwardrecord component
-
backward
public double backward()Returns the value of thebackwardrecord component.- Returns:
- the value of the
backwardrecord component
-
order
public int order()Returns the value of theorderrecord component.- Returns:
- the value of the
orderrecord component
-
period
public int period()Returns the value of theperiodrecord component.- Returns:
- the value of the
periodrecord component
-
showEquation
public boolean showEquation()Returns the value of theshowEquationrecord component.- Returns:
- the value of the
showEquationrecord component
-
showRSquared
public boolean showRSquared()Returns the value of theshowRSquaredrecord component.- Returns:
- the value of the
showRSquaredrecord component
-