Package adams.data.timeseries
Class PeriodicityHelper
- java.lang.Object
-
- adams.data.timeseries.PeriodicityHelper
-
public class PeriodicityHelper extends Object
Helper class for periodicity related calculations.- Version:
- $Revision$
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
-
-
Field Summary
Fields Modifier and Type Field Description static String
FILENAME
the properties file.protected static Properties
m_Properties
the properties.
-
Constructor Summary
Constructors Constructor Description PeriodicityHelper()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static gnu.trove.list.array.TDoubleArrayList
calculate(PeriodicityType type, double left, Date leftDate, Calendar leftCal, double right, Date rightDate, Calendar rightCal)
Calculates the per periodicity values.protected static gnu.trove.list.array.TDoubleArrayList
calculateDaily(double left, Date leftDate, Calendar leftCal, double right, Date rightDate, Calendar rightCal)
Calculates the daily values.protected static gnu.trove.list.array.TDoubleArrayList
calculateHalfDaily(double left, Date leftDate, Calendar leftCal, double right, Date rightDate, Calendar rightCal)
Calculates the half-daily values.protected static gnu.trove.list.array.TDoubleArrayList
calculateHalfHourly(double left, Date leftDate, Calendar leftCal, double right, Date rightDate, Calendar rightCal)
Calculates the half-hourly values.protected static gnu.trove.list.array.TDoubleArrayList
calculateHourly(double left, Date leftDate, Calendar leftCal, double right, Date rightDate, Calendar rightCal)
Calculates the hourly values.protected static gnu.trove.list.array.TDoubleArrayList
calculateMonthly(double left, Date leftDate, Calendar leftCal, double right, Date rightDate, Calendar rightCal)
Calculates the monthly values.protected static gnu.trove.list.array.TDoubleArrayList
calculatePerMinute(double left, Date leftDate, Calendar leftCal, double right, Date rightDate, Calendar rightCal)
Calculates the per minute values.protected static gnu.trove.list.array.TDoubleArrayList
calculateQuarterly(double left, Date leftDate, Calendar leftCal, double right, Date rightDate, Calendar rightCal)
Calculates the quarterly values.protected static gnu.trove.list.array.TDoubleArrayList
calculateWeekly(double left, Date leftDate, Calendar leftCal, double right, Date rightDate, Calendar rightCal)
Calculates the weekly values.protected static gnu.trove.list.array.TDoubleArrayList
calculateYearly(double left, Date leftDate, Calendar leftCal, double right, Date rightDate, Calendar rightCal)
Calculates the yearly values.static String
getFormat(PeriodicityType type)
Returns the format associated with the periodicity type.protected static Properties
getProperties()
Returns the properties.
-
-
-
Field Detail
-
FILENAME
public static final String FILENAME
the properties file.- See Also:
- Constant Field Values
-
m_Properties
protected static Properties m_Properties
the properties.
-
-
Method Detail
-
getProperties
protected static Properties getProperties()
Returns the properties.- Returns:
- the properties
-
calculateYearly
protected static gnu.trove.list.array.TDoubleArrayList calculateYearly(double left, Date leftDate, Calendar leftCal, double right, Date rightDate, Calendar rightCal)
Calculates the yearly values.- Parameters:
left
- the left-most valueleftDate
- the left-most dateleftCal
- the calendar for the left-most dateright
- the right-most valuerightDate
- the right-most daterightCal
- the calendar for the right-most date- Returns:
- the raw values
-
calculateQuarterly
protected static gnu.trove.list.array.TDoubleArrayList calculateQuarterly(double left, Date leftDate, Calendar leftCal, double right, Date rightDate, Calendar rightCal)
Calculates the quarterly values.- Parameters:
left
- the left-most valueleftDate
- the left-most dateleftCal
- the calendar for the left-most dateright
- the right-most valuerightDate
- the right-most daterightCal
- the calendar for the right-most date- Returns:
- the raw values
-
calculateMonthly
protected static gnu.trove.list.array.TDoubleArrayList calculateMonthly(double left, Date leftDate, Calendar leftCal, double right, Date rightDate, Calendar rightCal)
Calculates the monthly values.- Parameters:
left
- the left-most valueleftDate
- the left-most dateleftCal
- the calendar for the left-most dateright
- the right-most valuerightDate
- the right-most daterightCal
- the calendar for the right-most date- Returns:
- the raw values
-
calculateWeekly
protected static gnu.trove.list.array.TDoubleArrayList calculateWeekly(double left, Date leftDate, Calendar leftCal, double right, Date rightDate, Calendar rightCal)
Calculates the weekly values.- Parameters:
left
- the left-most valueleftDate
- the left-most dateleftCal
- the calendar for the left-most dateright
- the right-most valuerightDate
- the right-most daterightCal
- the calendar for the right-most date- Returns:
- the raw values
-
calculateDaily
protected static gnu.trove.list.array.TDoubleArrayList calculateDaily(double left, Date leftDate, Calendar leftCal, double right, Date rightDate, Calendar rightCal)
Calculates the daily values.- Parameters:
left
- the left-most valueleftDate
- the left-most dateleftCal
- the calendar for the left-most dateright
- the right-most valuerightDate
- the right-most daterightCal
- the calendar for the right-most date- Returns:
- the raw values
-
calculateHalfDaily
protected static gnu.trove.list.array.TDoubleArrayList calculateHalfDaily(double left, Date leftDate, Calendar leftCal, double right, Date rightDate, Calendar rightCal)
Calculates the half-daily values.- Parameters:
left
- the left-most valueleftDate
- the left-most dateleftCal
- the calendar for the left-most dateright
- the right-most valuerightDate
- the right-most daterightCal
- the calendar for the right-most date- Returns:
- the raw values
-
calculateHourly
protected static gnu.trove.list.array.TDoubleArrayList calculateHourly(double left, Date leftDate, Calendar leftCal, double right, Date rightDate, Calendar rightCal)
Calculates the hourly values.- Parameters:
left
- the left-most valueleftDate
- the left-most dateleftCal
- the calendar for the left-most dateright
- the right-most valuerightDate
- the right-most daterightCal
- the calendar for the right-most date- Returns:
- the raw values
-
calculateHalfHourly
protected static gnu.trove.list.array.TDoubleArrayList calculateHalfHourly(double left, Date leftDate, Calendar leftCal, double right, Date rightDate, Calendar rightCal)
Calculates the half-hourly values.- Parameters:
left
- the left-most valueleftDate
- the left-most dateleftCal
- the calendar for the left-most dateright
- the right-most valuerightDate
- the right-most daterightCal
- the calendar for the right-most date- Returns:
- the raw values
-
calculatePerMinute
protected static gnu.trove.list.array.TDoubleArrayList calculatePerMinute(double left, Date leftDate, Calendar leftCal, double right, Date rightDate, Calendar rightCal)
Calculates the per minute values.- Parameters:
left
- the left-most valueleftDate
- the left-most dateleftCal
- the calendar for the left-most dateright
- the right-most valuerightDate
- the right-most daterightCal
- the calendar for the right-most date- Returns:
- the raw values
-
calculate
public static gnu.trove.list.array.TDoubleArrayList calculate(PeriodicityType type, double left, Date leftDate, Calendar leftCal, double right, Date rightDate, Calendar rightCal)
Calculates the per periodicity values.- Parameters:
type
- the type of periodicity to calculateleft
- the left-most valueleftDate
- the left-most dateleftCal
- the calendar for the left-most dateright
- the right-most valuerightDate
- the right-most daterightCal
- the calendar for the right-most date- Returns:
- the raw values
-
getFormat
public static String getFormat(PeriodicityType type)
Returns the format associated with the periodicity type.- Parameters:
type
- the type of periodicity- Returns:
- the associated type
-
-