コード例 #1
0
 /**
  * Get data between two points in delta form.
  *
  * @param desc The data description.
  * @param index The index to get data from.
  * @return The requested data.
  */
 private double getDataDeltaChange(final TemporalDataDescription desc, final int index) {
   if (index == 0) {
     return 0.0;
   }
   final TemporalPoint point = this.points.get(index);
   final TemporalPoint previousPoint = this.points.get(index - 1);
   return point.getData(desc.getIndex()) - previousPoint.getData(desc.getIndex());
 }
コード例 #2
0
 /**
  * Get data between two points in percent form.
  *
  * @param desc The data description.
  * @param index The index to get data from.
  * @return The requested data.
  */
 private double getDataPercentChange(final TemporalDataDescription desc, final int index) {
   if (index == 0) {
     return 0.0;
   }
   final TemporalPoint point = this.points.get(index);
   final TemporalPoint previousPoint = this.points.get(index - 1);
   final double currentValue = point.getData(desc.getIndex());
   final double previousValue = previousPoint.getData(desc.getIndex());
   return (currentValue - previousValue) / previousValue;
 }
コード例 #3
0
 /**
  * Get data between two points in raw form.
  *
  * @param desc The data description.
  * @param index The index to get data from.
  * @return The requested data.
  */
 private double getDataRAW(final TemporalDataDescription desc, final int index) {
   final TemporalPoint point = this.points.get(index - 1);
   return point.getData(desc.getIndex());
 }