Class ObservedPoints

java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractList<org.apache.commons.math3.fitting.WeightedObservedPoint>
nz.org.riskscape.defaults.curves.ObservedPoints
All Implemented Interfaces:
Iterable<org.apache.commons.math3.fitting.WeightedObservedPoint>, Collection<org.apache.commons.math3.fitting.WeightedObservedPoint>, List<org.apache.commons.math3.fitting.WeightedObservedPoint>

public class ObservedPoints extends AbstractList<org.apache.commons.math3.fitting.WeightedObservedPoint>
  • Constructor Details

    • ObservedPoints

      public ObservedPoints(nz.org.riskscape.engine.util.SegmentedList<Double> xValues, nz.org.riskscape.engine.util.SegmentedList<Double> yValues)
  • Method Details

    • iterator

      public Iterator<org.apache.commons.math3.fitting.WeightedObservedPoint> iterator()
      Specified by:
      iterator in interface Collection<org.apache.commons.math3.fitting.WeightedObservedPoint>
      Specified by:
      iterator in interface Iterable<org.apache.commons.math3.fitting.WeightedObservedPoint>
      Specified by:
      iterator in interface List<org.apache.commons.math3.fitting.WeightedObservedPoint>
      Overrides:
      iterator in class AbstractList<org.apache.commons.math3.fitting.WeightedObservedPoint>
    • size

      public int size()
      Specified by:
      size in interface Collection<org.apache.commons.math3.fitting.WeightedObservedPoint>
      Specified by:
      size in interface List<org.apache.commons.math3.fitting.WeightedObservedPoint>
      Specified by:
      size in class AbstractCollection<org.apache.commons.math3.fitting.WeightedObservedPoint>
    • get

      public org.apache.commons.math3.fitting.WeightedObservedPoint get(int index)
      Specified by:
      get in interface List<org.apache.commons.math3.fitting.WeightedObservedPoint>
      Specified by:
      get in class AbstractList<org.apache.commons.math3.fitting.WeightedObservedPoint>
    • withLogX

      public List<org.apache.commons.math3.fitting.WeightedObservedPoint> withLogX()
    • withLogY

      public List<org.apache.commons.math3.fitting.WeightedObservedPoint> withLogY()
    • withLogXLogY

      public List<org.apache.commons.math3.fitting.WeightedObservedPoint> withLogXLogY()
    • asListOfPairs

      public List<nz.org.riskscape.engine.util.Pair<Double,Double>> asListOfPairs()
      Returns:
      a view of this list as pairs. WeightedObservedPoint is missing many niceities, like equals, or toString, which can be useful/important.
    • getYValues

      public Stream<Double> getYValues()
      Returns:
      a Stream of all the y values in the set of observed points. This can be a 'cheaper' operation than getting the list of WeightedObservedPoints and streaming through those.
    • getXValues

      public Stream<Double> getXValues()
      Returns:
      a Stream of all the x values in the set of observed points. This can be a 'cheaper' operation than getting the list of WeightedObservedPoints and streaming through those.