Class LocalDateDoublePoint
- java.lang.Object
-
- com.opengamma.strata.collect.timeseries.LocalDateDoublePoint
-
- All Implemented Interfaces:
Comparable<LocalDateDoublePoint>
public final class LocalDateDoublePoint extends Object implements Comparable<LocalDateDoublePoint>
Immutable representation of a single point in aLocalDateDoubleTimeSeries
.This implementation uses arrays internally.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareTo(LocalDateDoublePoint other)
Compares this point to another.boolean
equals(Object obj)
Checks if this point is equal to another point.LocalDate
getDate()
Gets the date.double
getValue()
Gets the value.int
hashCode()
A hash code for this point.static LocalDateDoublePoint
of(LocalDate date, double value)
Obtains a point from date and value.String
toString()
Returns a string representation of the point.LocalDateDoublePoint
withDate(LocalDate date)
Returns a copy of this point with another date.LocalDateDoublePoint
withValue(double value)
Returns a copy of this point with another value.
-
-
-
Method Detail
-
of
public static LocalDateDoublePoint of(LocalDate date, double value)
Obtains a point from date and value.- Parameters:
date
- the datevalue
- the value- Returns:
- the point
-
getDate
public LocalDate getDate()
Gets the date.- Returns:
- the date
-
getValue
public double getValue()
Gets the value.- Returns:
- the value
-
withDate
public LocalDateDoublePoint withDate(LocalDate date)
Returns a copy of this point with another date.- Parameters:
date
- the date to change the point to- Returns:
- a point based on this point with the date changed
-
withValue
public LocalDateDoublePoint withValue(double value)
Returns a copy of this point with another value.- Parameters:
value
- the value to change the point to- Returns:
- a point based on this point with the value changed
-
compareTo
public int compareTo(LocalDateDoublePoint other)
Compares this point to another.The sort order is by date, then by double. This is compatible with equals.
- Specified by:
compareTo
in interfaceComparable<LocalDateDoublePoint>
- Parameters:
other
- the other point- Returns:
- negative if this is less than, zero if equal, positive if greater than
-
equals
public boolean equals(Object obj)
Checks if this point is equal to another point.
-
hashCode
public int hashCode()
A hash code for this point.
-
-