org.gillius.realdb.model.data
Class DiscontinuityInterval

java.lang.Object
  extended by org.gillius.realdb.model.data.DiscontinuityInterval
All Implemented Interfaces:
StreamInterval, Range

public class DiscontinuityInterval
extends java.lang.Object
implements StreamInterval

DiscontinuityInterval

Author:
Jason Winnebeck

Constructor Summary
DiscontinuityInterval(long startTime, long endTime)
           
 
Method Summary
 java.lang.Object getAverageValue(int element)
          Returns the average value for the element over this interval's time range.
 long getEndTime()
          Returns the end time (exclusive) of this interval.
 java.lang.Number getIntegral(int element)
          Returns the result of the definite integral between this interval's start and end times.
 java.lang.Object getMaximumValue(int element)
          Returns the maximum value for the element over this interval's time range.
 java.lang.Object getMinimumValue(int element)
          Returns the minimum value for the element over this interval's time range.
 int getNumElements()
          Returns the total number of elements (fields) in this interval, not including the timestamp.
 long getStartTime()
          Returns the starting time (inclusive) of this interval.
 long getTimespan()
          Returns StreamInterval.getEndTime() - StreamInterval.getStartTime().
 java.lang.Object getValueAt(long time, int element)
          Samples the value at the given time between startTime (inclusive) and endTime (exclusive).
 boolean isDiscontinuity()
          Returns true if this interval represents a discontinuity in the data stream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DiscontinuityInterval

public DiscontinuityInterval(long startTime,
                             long endTime)
Method Detail

isDiscontinuity

public boolean isDiscontinuity()
Description copied from interface: StreamInterval
Returns true if this interval represents a discontinuity in the data stream. Such an interval will have 0 elements.

Specified by:
isDiscontinuity in interface StreamInterval

getStartTime

public long getStartTime()
Description copied from interface: StreamInterval
Returns the starting time (inclusive) of this interval.

Specified by:
getStartTime in interface StreamInterval
Specified by:
getStartTime in interface Range

getEndTime

public long getEndTime()
Description copied from interface: StreamInterval
Returns the end time (exclusive) of this interval.

Specified by:
getEndTime in interface StreamInterval
Specified by:
getEndTime in interface Range

getTimespan

public long getTimespan()
Description copied from interface: StreamInterval
Returns StreamInterval.getEndTime() - StreamInterval.getStartTime().

Specified by:
getTimespan in interface StreamInterval

getNumElements

public int getNumElements()
Description copied from interface: StreamInterval
Returns the total number of elements (fields) in this interval, not including the timestamp.

Specified by:
getNumElements in interface StreamInterval

getValueAt

public java.lang.Object getValueAt(long time,
                                   int element)
Description copied from interface: StreamInterval
Samples the value at the given time between startTime (inclusive) and endTime (exclusive). The result of calling this method with a time less than startTime or greater than or equal to endTime is undefined. It may throw IllegalArgumentException, but is not guaranteed to.

Specified by:
getValueAt in interface StreamInterval

getAverageValue

public java.lang.Object getAverageValue(int element)
Description copied from interface: StreamInterval
Returns the average value for the element over this interval's time range. For non-numeric types, such as Boolean, this method returns the exact value.

Specified by:
getAverageValue in interface StreamInterval

getMaximumValue

public java.lang.Object getMaximumValue(int element)
Description copied from interface: StreamInterval
Returns the maximum value for the element over this interval's time range. For non-numeric types, such as Boolean, this method returns the exact value.

Specified by:
getMaximumValue in interface StreamInterval

getMinimumValue

public java.lang.Object getMinimumValue(int element)
Description copied from interface: StreamInterval
Returns the minimum value for the element over this interval's time range. For non-numeric types, such as Boolean, this method returns the exact value.

Specified by:
getMinimumValue in interface StreamInterval

getIntegral

public java.lang.Number getIntegral(int element)
Description copied from interface: StreamInterval
Returns the result of the definite integral between this interval's start and end times. For non-numeric ElementTypes (such as Boolean), or for ElementCodecs that do not represent continuous ranges (such as SampledAlgorithm) this method always returns null. For numeric ElementTypes, this method always returns a Number object of the appropriate type.

Specified by:
getIntegral in interface StreamInterval


Copyright © 2008-2010 Jason Winnebeck. All Rights Reserved.