Package com.groiss.reporting.data.impl
Class TimeInterval
java.lang.Object
com.groiss.reporting.export.AbstractReportingExportable
com.groiss.reporting.data.impl.DefaultReportingData
com.groiss.reporting.data.impl.TimeInterval
- All Implemented Interfaces:
Expandable
,NumericValue
,ReportingData
,TimeModel
,ReportingExportable
,Cloneable
,Comparable<ReportingExportable>
Reporting data type for time intervals.
-
Field Summary
Fields inherited from class com.groiss.reporting.data.impl.DefaultReportingData
a, alias, attributeHasUserdefType, dontUseMappedString, e, value
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionadd
(NumericValue v2) Adds the Values of two NumericValue Objectsvoid
addClientConditionWidgetOptions
(JSONObject json, boolean paramAtExec, Element condition) add clientcondition attributes to attribute storevoid
addConditionToQuery
(Query q, Element c) Adds the XMLAttribute as a conditon to the query.protected static Long
addIntervals
(Long i1, Long i2) avg
(long count) Calculates the average of a numeric data.int
completeSeries
(Set<ReportingExportable> series, Query q) invoked for matrix-style reports to be able to add missing entries in the givenseries
final void
copyData
(TimeInterval val) returns the list ofReportingExportable
s the current item should be expanded toprotected Long
getInterval
(Pair<Date, Date> data) long
getInterval
(Date start, Date end) calculates the time intervalprotected Long
getInterval
(Date start, Date end, Query q) returns the Name of the Model for HTML purposegetValue()
final void
setDateformat
(String dateformat) final void
setTimeModelAndUnit
(TimeModel model, String maxunit, String minunit) void
void
Deprecated.void
Sets the value of this object.protected static Long
subIntervals
(Long i1, Long i2) toText()
Used for CSV/EXCEL/XML export...Methods inherited from class com.groiss.reporting.data.impl.DefaultReportingData
addIgnoreCaseComponents, addSelectAttributeToQuery, checkTempJoin, compare2, getAlias, getAttribute, getBaseType, getColumnRenderer, getDBData, getEntity, getMappedValue, getMappedValues, getOperatorList, hasAttributeUserdefinedType, hasMappedValues, pairList, pairList, pairList, pairList, setAlias, setAttribute, setAttributeHasUserdefinedType, setEntity, setMappedValue, splitValueAttribute, toHtml, toJson, toString
Methods inherited from class com.groiss.reporting.export.AbstractReportingExportable
getSortText
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.groiss.reporting.export.ReportingExportable
getColumnRenderer, getSortText, toJson
-
Field Details
-
toAdd
-
toSubduct
-
minunit
-
maxunit
-
timemodel
-
-
Constructor Details
-
TimeInterval
public TimeInterval()
-
-
Method Details
-
addClientConditionWidgetOptions
public void addClientConditionWidgetOptions(JSONObject json, boolean paramAtExec, Element condition) Description copied from interface:ReportingData
add clientcondition attributes to attribute store- Specified by:
addClientConditionWidgetOptions
in interfaceReportingData
- Overrides:
addClientConditionWidgetOptions
in classDefaultReportingData
- Parameters:
json
- the json object of this attributeparamAtExec
- indicates if method is called in normal condition or param-at-execution modecondition
- the optional <condition> element. Can be used to mimic special behavior for parameter-at-execution scenarios
-
addConditionToQuery
Description copied from interface:ReportingData
Adds the XMLAttribute as a conditon to the query. Has to callQuery.addCondition(String, String, String, String, List)
- Specified by:
addConditionToQuery
in interfaceReportingData
- Overrides:
addConditionToQuery
in classDefaultReportingData
- Parameters:
q
- - the query Object, where condtion has to be addedc
- - the xml element of type condition
-
setValue
Description copied from interface:ReportingData
Sets the value of this object. Value is gained from resultset.- Specified by:
setValue
in interfaceReportingData
- Overrides:
setValue
in classDefaultReportingData
- Parameters:
rs
- - the result set of the queryselectAttribute
- - the xml-element attribute of the queryq
- - the query object- See Also:
-
getInterval
-
getInterval
-
getInterval
Description copied from interface:TimeModel
calculates the time interval- Specified by:
getInterval
in interfaceTimeModel
- Parameters:
start
- the start date of the intervalend
- the end date of the interval- Returns:
- the calculated interval im milliseconds
-
toText
Description copied from interface:ReportingExportable
Used for CSV/EXCEL/XML export...- Specified by:
toText
in interfaceReportingExportable
- Overrides:
toText
in classDefaultReportingData
- Returns:
- the String representation of this Object
-
getPairValue
-
getValue
- Specified by:
getValue
in interfaceReportingExportable
- Overrides:
getValue
in classDefaultReportingData
- Returns:
- the value of this object
-
compareTo
- Specified by:
compareTo
in interfaceComparable<ReportingExportable>
- Specified by:
compareTo
in interfaceReportingExportable
- Overrides:
compareTo
in classDefaultReportingData
-
addIntervals
-
subIntervals
-
add
Description copied from interface:NumericValue
Adds the Values of two NumericValue Objects- Specified by:
add
in interfaceNumericValue
- Overrides:
add
in classDefaultReportingData
- Parameters:
v2
- the second NumericValue to add- Returns:
- the Object with the added NumericValue
-
avg
Description copied from interface:NumericValue
Calculates the average of a numeric data.- Specified by:
avg
in interfaceNumericValue
- Overrides:
avg
in classDefaultReportingData
- Parameters:
count
- the amount of NumericValue Objects- Returns:
- a NumericValue Object containing the average value
-
getModelName
Description copied from interface:TimeModel
returns the Name of the Model for HTML purpose- Specified by:
getModelName
in interfaceTimeModel
- Returns:
- the I18N string represent of this timemodel
-
setTimeModelAndUnit
-
copyData
-
setValue
Deprecated.Description copied from interface:ReportingExportable
Sets the value for this object- Specified by:
setValue
in interfaceReportingExportable
- Overrides:
setValue
in classDefaultReportingData
- Parameters:
o
- - the value object
-
setValue
-
setDateformat
-
expand
Description copied from interface:Expandable
returns the list ofReportingExportable
s the current item should be expanded to- Specified by:
expand
in interfaceExpandable
- Parameters:
query
- the query- Returns:
-
completeSeries
Description copied from interface:ReportingData
invoked for matrix-style reports to be able to add missing entries in the givenseries
- Specified by:
completeSeries
in interfaceReportingData
- Overrides:
completeSeries
in classDefaultReportingData
- Parameters:
series
- the current values from the DBq
- the query- Returns:
- the full series (e.g. for dates all dates from t1-t2, for persistents all elements of a certain type etc.)
-