Package org.openrefine.browsing.util
Class TimeRangeStatistics
- java.lang.Object
-
- org.openrefine.browsing.util.TimeRangeStatistics
-
- All Implemented Interfaces:
Serializable
public class TimeRangeStatistics extends Object implements Serializable
Stores statistics related to time values stored in a set of rows (generated by an expression). The time values are represented as milliseconds since Epoch, and stored individually in an array. This is different from the numeric facet which does the binning on the fly, because the various possible scales for the timeline facet do not align (for instance, years are not integer multiples of days).- Author:
- Antonin Delpeuch
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description TimeRangeStatistics(int timeCount, long nonTimeCount, long blankCount, long errorCount, long[] timeValues)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TimeRangeStatistics
addCounts(long nonTime, long blank, long error)
Adds counts to the auxiliary fields.TimeRangeStatistics
addTime(long timeValue)
Adds a valid time value represented as milliseconds since Epoch.boolean
equals(Object other)
long
getBlankCount()
long
getErrorCount()
long
getNonTimeCount()
long[]
getRawTimeValues()
The array of time values might be longer than the number of time values actually stored - seegetTimeCount()
to get the actual number of values stored.int
getTimeCount()
long[]
getTimeValues()
Actual array of time values stored by this object, without the blank padding space at the end.int
hashCode()
TimeRangeStatistics
sum(TimeRangeStatistics other)
Sums the statistics with another one.String
toString()
-
-
-
Method Detail
-
getTimeCount
public int getTimeCount()
-
getNonTimeCount
public long getNonTimeCount()
-
getBlankCount
public long getBlankCount()
-
getErrorCount
public long getErrorCount()
-
getRawTimeValues
public long[] getRawTimeValues()
The array of time values might be longer than the number of time values actually stored - seegetTimeCount()
to get the actual number of values stored.
-
getTimeValues
public long[] getTimeValues()
Actual array of time values stored by this object, without the blank padding space at the end.
-
addCounts
public TimeRangeStatistics addCounts(long nonTime, long blank, long error)
Adds counts to the auxiliary fields.- Parameters:
nonTime
-blank
-error
-- Returns:
-
addTime
public TimeRangeStatistics addTime(long timeValue)
Adds a valid time value represented as milliseconds since Epoch.- Parameters:
timeValue
-- Returns:
-
sum
public TimeRangeStatistics sum(TimeRangeStatistics other)
Sums the statistics with another one.
-
-