|
![]() Quark Platform Documentation Version 1.7.1_0 Business Objects |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.openquark.cal.module.Cal.Data.CAL_BusinessCalendar.Functions
public static final class CAL_BusinessCalendar.Functions
This inner class (Functions) contains constants and methods related to binding to CAL functions in the Cal.Data.BusinessCalendar module.
| Field Summary | |
|---|---|
static QualifiedName |
canRollUpTimePeriod
Name binding for function: canRollUpTimePeriod. |
static QualifiedName |
getBasePeriod
Name binding for function: getBasePeriod. |
static QualifiedName |
getBasePeriodType
Name binding for function: getBasePeriodType. |
static QualifiedName |
getBasePeriodValue
Name binding for function: getBasePeriodValue. |
static QualifiedName |
getChildPeriodValues
Name binding for function: getChildPeriodValues. |
static QualifiedName |
getPeriodFromTime
Name binding for function: getPeriodFromTime. |
static QualifiedName |
getPeriodTimeRange
Name binding for function: getPeriodTimeRange. |
static QualifiedName |
getPeriodTypeName
Name binding for function: getPeriodTypeName. |
static QualifiedName |
getPeriodValue
Name binding for function: getPeriodValue. |
static QualifiedName |
getPeriodValueFromTime
Name binding for function: getPeriodValueFromTime. |
static QualifiedName |
getPeriodValueRange
Name binding for function: getPeriodValueRange. |
static QualifiedName |
getPeriodValues
Name binding for function: getPeriodValues. |
static QualifiedName |
getTimePartExpr
Name binding for function: getTimePartExpr. |
static QualifiedName |
getValidBasePeriodValues
Name binding for function: getValidBasePeriodValues. |
static QualifiedName |
getValidChildTimePeriods
Name binding for function: getValidChildTimePeriods. |
static QualifiedName |
getValidParentTimePeriods
Name binding for function: getValidParentTimePeriods. |
static QualifiedName |
intToPeriodType
Name binding for function: intToPeriodType. |
static QualifiedName |
makeBusinessCalendar
Name binding for function: makeBusinessCalendar. |
static QualifiedName |
makeChildPeriod
Name binding for function: makeChildPeriod. |
static QualifiedName |
makePeriod
Name binding for function: makePeriod. |
static QualifiedName |
periodDisplayName
Name binding for function: periodDisplayName. |
static QualifiedName |
periodTypeToInt
Name binding for function: periodTypeToInt. |
static QualifiedName |
setBasePeriodValue
Name binding for function: setBasePeriodValue. |
static QualifiedName |
shiftByNPeriods
Name binding for function: shiftByNPeriods. |
| Constructor Summary | |
|---|---|
CAL_BusinessCalendar.Functions()
|
|
| Method Summary | |
|---|---|
static SourceModel.Expr |
canRollUpTimePeriod(SourceModel.Expr childPeriod,
SourceModel.Expr parentPeriod)
Returns whether the specified child Cal.Data.BusinessCalendar.PeriodType can
roll up into the parent Cal.Data.BusinessCalendar.PeriodType. |
static SourceModel.Expr |
getBasePeriod(SourceModel.Expr period)
Returns the lowest level Cal.Data.BusinessCalendar.PeriodType in the
Cal.Data.BusinessCalendar.Period and the corresponding value. |
static SourceModel.Expr |
getBasePeriodType(SourceModel.Expr arg_1)
Returns the lowest level Cal.Data.BusinessCalendar.PeriodType in the
Cal.Data.BusinessCalendar.Period. |
static SourceModel.Expr |
getBasePeriodValue(SourceModel.Expr arg_1)
Returns the value for the lowest level Cal.Data.BusinessCalendar.PeriodType
in the Cal.Data.BusinessCalendar.Period. |
static SourceModel.Expr |
getChildPeriodValues(SourceModel.Expr businessCalendar,
SourceModel.Expr parentPeriod,
SourceModel.Expr periodType,
SourceModel.Expr maybeMinValue,
SourceModel.Expr maybeMaxValue)
Returns the list of valid values (and the corresponding string representations) for the specified Cal.Data.BusinessCalendar.PeriodType in the given
Cal.Data.BusinessCalendar.Period. |
static SourceModel.Expr |
getPeriodFromTime(SourceModel.Expr businessCalendar,
SourceModel.Expr time,
SourceModel.Expr periodTypes)
Queries a given Cal.Data.BusinessCalendar.BusinessCalendar to convert a time
value into a Cal.Data.BusinessCalendar.Period with the specified
Cal.Data.BusinessCalendar.PeriodTypes. |
static SourceModel.Expr |
getPeriodTimeRange(SourceModel.Expr businessCalendar,
SourceModel.Expr period)
Queries a given Cal.Data.BusinessCalendar.BusinessCalendar to determine the
time range corresponding to the given Cal.Data.BusinessCalendar.Period. |
static SourceModel.Expr |
getPeriodTypeName(SourceModel.Expr periodType)
Returns a descriptive name for the Cal.Data.BusinessCalendar.PeriodType. |
static SourceModel.Expr |
getPeriodValue(SourceModel.Expr period,
SourceModel.Expr periodType)
Returns the value of the specified Cal.Data.BusinessCalendar.PeriodType in
the Cal.Data.BusinessCalendar.Period. |
static SourceModel.Expr |
getPeriodValueFromTime(SourceModel.Expr businessCalendar,
SourceModel.Expr time,
SourceModel.Expr periodType)
Queries a given Cal.Data.BusinessCalendar.BusinessCalendar to determine the
value of a given Cal.Data.BusinessCalendar.PeriodType for the specified time. |
static SourceModel.Expr |
getPeriodValueRange(SourceModel.Expr businessCalendar,
SourceModel.Expr parentPeriod,
SourceModel.Expr periodType)
Queries a given Cal.Data.BusinessCalendar.BusinessCalendar to determine
what range of values are possible for a specified Cal.Data.BusinessCalendar.PeriodType
within a specified Cal.Data.BusinessCalendar.Period. |
static SourceModel.Expr |
getPeriodValues(SourceModel.Expr period)
Returns a list Cal.Data.BusinessCalendar.PeriodType-value pairs for the
Cal.Data.BusinessCalendar.Period. |
static SourceModel.Expr |
getTimePartExpr(SourceModel.Expr businessCalendar,
SourceModel.Expr baseTimeExpr,
SourceModel.Expr periodType)
Queries a given Cal.Data.BusinessCalendar.BusinessCalendar to determine the
database expression to extract the value of the Cal.Data.BusinessCalendar.PeriodType
from the specified time expression. |
static SourceModel.Expr |
getValidBasePeriodValues(SourceModel.Expr businessCalendar,
SourceModel.Expr period)
Queries a given Cal.Data.BusinessCalendar.BusinessCalendar to determine the
range of possible values for the base Cal.Data.BusinessCalendar.PeriodType
of a Cal.Data.BusinessCalendar.Period. |
static SourceModel.Expr |
getValidChildTimePeriods(SourceModel.Expr parentPeriod)
Returns a list of the valid child Cal.Data.BusinessCalendar.PeriodType values
which can roll up into the specified parent Cal.Data.BusinessCalendar.PeriodType. |
static SourceModel.Expr |
getValidParentTimePeriods(SourceModel.Expr childPeriod)
Returns a list of the valid parent Cal.Data.BusinessCalendar.PeriodType values
into which a child Cal.Data.BusinessCalendar.PeriodType can roll up. |
static SourceModel.Expr |
intToPeriodType(int intVal)
|
static SourceModel.Expr |
intToPeriodType(SourceModel.Expr intVal)
Retrieves the Cal.Data.BusinessCalendar.PeriodType corresponding to a given ordinal. |
static SourceModel.Expr |
makeBusinessCalendar(SourceModel.Expr periodValueRangeFn,
SourceModel.Expr periodDisplayNameFn,
SourceModel.Expr periodTimeRangeFn,
SourceModel.Expr periodValueFromTimeFn,
SourceModel.Expr timePartExprFn)
Construct a new Cal.Data.BusinessCalendar.BusinessCalendar with the specified behavior. |
static SourceModel.Expr |
makeChildPeriod(SourceModel.Expr parentPeriod,
SourceModel.Expr childPeriodType,
int childPeriodValue)
|
static SourceModel.Expr |
makeChildPeriod(SourceModel.Expr parentPeriod,
SourceModel.Expr childPeriodType,
SourceModel.Expr childPeriodValue)
Constructs a Cal.Data.BusinessCalendar.Period from a containing
Cal.Data.BusinessCalendar.Period value. |
static SourceModel.Expr |
makePeriod(SourceModel.Expr periodValues)
Constructs a Cal.Data.BusinessCalendar.Period from its
Cal.Data.BusinessCalendar.Period values. |
static SourceModel.Expr |
periodDisplayName(SourceModel.Expr businessCalendar,
SourceModel.Expr parentPeriod,
SourceModel.Expr periodType,
int periodValue)
|
static SourceModel.Expr |
periodDisplayName(SourceModel.Expr businessCalendar,
SourceModel.Expr parentPeriod,
SourceModel.Expr periodType,
SourceModel.Expr periodValue)
Queries a given Cal.Data.BusinessCalendar.BusinessCalendar to determine the
display string of a given Cal.Data.BusinessCalendar.PeriodType and value
with a specified Cal.Data.BusinessCalendar.Period as context. |
static SourceModel.Expr |
periodTypeToInt(SourceModel.Expr periodType)
Retrieves the ordinal corresponding to a given Cal.Data.BusinessCalendar.PeriodType. |
static SourceModel.Expr |
setBasePeriodValue(SourceModel.Expr period,
int newBasePeriodValue)
|
static SourceModel.Expr |
setBasePeriodValue(SourceModel.Expr period,
SourceModel.Expr newBasePeriodValue)
Sets the value for the lowest level Cal.Data.BusinessCalendar.PeriodType
in the Cal.Data.BusinessCalendar.Period. |
static SourceModel.Expr |
shiftByNPeriods(SourceModel.Expr businessCalendar,
SourceModel.Expr origPeriod,
SourceModel.Expr periodType,
int shiftAmount)
|
static SourceModel.Expr |
shiftByNPeriods(SourceModel.Expr businessCalendar,
SourceModel.Expr origPeriod,
SourceModel.Expr periodType,
SourceModel.Expr shiftAmount)
Adds an offset to the specified period type of the period. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final QualifiedName canRollUpTimePeriod
canRollUpTimePeriod(org.openquark.cal.compiler.SourceModel.Expr, org.openquark.cal.compiler.SourceModel.Expr)public static final QualifiedName getBasePeriod
getBasePeriod(org.openquark.cal.compiler.SourceModel.Expr)public static final QualifiedName getBasePeriodType
getBasePeriodType(org.openquark.cal.compiler.SourceModel.Expr)public static final QualifiedName getBasePeriodValue
getBasePeriodValue(org.openquark.cal.compiler.SourceModel.Expr)public static final QualifiedName getChildPeriodValues
getChildPeriodValues(org.openquark.cal.compiler.SourceModel.Expr, org.openquark.cal.compiler.SourceModel.Expr, org.openquark.cal.compiler.SourceModel.Expr, org.openquark.cal.compiler.SourceModel.Expr, org.openquark.cal.compiler.SourceModel.Expr)public static final QualifiedName getPeriodFromTime
getPeriodFromTime(org.openquark.cal.compiler.SourceModel.Expr, org.openquark.cal.compiler.SourceModel.Expr, org.openquark.cal.compiler.SourceModel.Expr)public static final QualifiedName getPeriodTimeRange
getPeriodTimeRange(org.openquark.cal.compiler.SourceModel.Expr, org.openquark.cal.compiler.SourceModel.Expr)public static final QualifiedName getPeriodTypeName
getPeriodTypeName(org.openquark.cal.compiler.SourceModel.Expr)public static final QualifiedName getPeriodValue
getPeriodValue(org.openquark.cal.compiler.SourceModel.Expr, org.openquark.cal.compiler.SourceModel.Expr)public static final QualifiedName getPeriodValueFromTime
getPeriodValueFromTime(org.openquark.cal.compiler.SourceModel.Expr, org.openquark.cal.compiler.SourceModel.Expr, org.openquark.cal.compiler.SourceModel.Expr)public static final QualifiedName getPeriodValueRange
getPeriodValueRange(org.openquark.cal.compiler.SourceModel.Expr, org.openquark.cal.compiler.SourceModel.Expr, org.openquark.cal.compiler.SourceModel.Expr)public static final QualifiedName getPeriodValues
getPeriodValues(org.openquark.cal.compiler.SourceModel.Expr)public static final QualifiedName getTimePartExpr
getTimePartExpr(org.openquark.cal.compiler.SourceModel.Expr, org.openquark.cal.compiler.SourceModel.Expr, org.openquark.cal.compiler.SourceModel.Expr)public static final QualifiedName getValidBasePeriodValues
getValidBasePeriodValues(org.openquark.cal.compiler.SourceModel.Expr, org.openquark.cal.compiler.SourceModel.Expr)public static final QualifiedName getValidChildTimePeriods
getValidChildTimePeriods(org.openquark.cal.compiler.SourceModel.Expr)public static final QualifiedName getValidParentTimePeriods
getValidParentTimePeriods(org.openquark.cal.compiler.SourceModel.Expr)public static final QualifiedName intToPeriodType
intToPeriodType(org.openquark.cal.compiler.SourceModel.Expr)public static final QualifiedName makeBusinessCalendar
makeBusinessCalendar(org.openquark.cal.compiler.SourceModel.Expr, org.openquark.cal.compiler.SourceModel.Expr, org.openquark.cal.compiler.SourceModel.Expr, org.openquark.cal.compiler.SourceModel.Expr, org.openquark.cal.compiler.SourceModel.Expr)public static final QualifiedName makeChildPeriod
makeChildPeriod(org.openquark.cal.compiler.SourceModel.Expr, org.openquark.cal.compiler.SourceModel.Expr, org.openquark.cal.compiler.SourceModel.Expr)public static final QualifiedName makePeriod
makePeriod(org.openquark.cal.compiler.SourceModel.Expr)public static final QualifiedName periodDisplayName
periodDisplayName(org.openquark.cal.compiler.SourceModel.Expr, org.openquark.cal.compiler.SourceModel.Expr, org.openquark.cal.compiler.SourceModel.Expr, org.openquark.cal.compiler.SourceModel.Expr)public static final QualifiedName periodTypeToInt
periodTypeToInt(org.openquark.cal.compiler.SourceModel.Expr)public static final QualifiedName setBasePeriodValue
setBasePeriodValue(org.openquark.cal.compiler.SourceModel.Expr, org.openquark.cal.compiler.SourceModel.Expr)public static final QualifiedName shiftByNPeriods
shiftByNPeriods(org.openquark.cal.compiler.SourceModel.Expr, org.openquark.cal.compiler.SourceModel.Expr, org.openquark.cal.compiler.SourceModel.Expr, org.openquark.cal.compiler.SourceModel.Expr)| Constructor Detail |
|---|
public CAL_BusinessCalendar.Functions()
| Method Detail |
|---|
public static final SourceModel.Expr canRollUpTimePeriod(SourceModel.Expr childPeriod,
SourceModel.Expr parentPeriod)
Cal.Data.BusinessCalendar.PeriodType can
roll up into the parent Cal.Data.BusinessCalendar.PeriodType.
childPeriod - (CAL type: Cal.Data.BusinessCalendar.PeriodType)parentPeriod - (CAL type: Cal.Data.BusinessCalendar.PeriodType)
Cal.Core.Prelude.Boolean)public static final SourceModel.Expr getBasePeriod(SourceModel.Expr period)
Cal.Data.BusinessCalendar.PeriodType in the
Cal.Data.BusinessCalendar.Period and the corresponding value.
Cal.Data.BusinessCalendar.NoPeriod and an error are returned if there are no
values in the Cal.Data.BusinessCalendar.Period.
period - (CAL type: Cal.Data.BusinessCalendar.Period)
(Cal.Data.BusinessCalendar.PeriodType, Cal.Core.Prelude.Int))public static final SourceModel.Expr getBasePeriodType(SourceModel.Expr arg_1)
Cal.Data.BusinessCalendar.PeriodType in the
Cal.Data.BusinessCalendar.Period.
Cal.Data.BusinessCalendar.NoPeriod is returned if there are no values in the
Cal.Data.BusinessCalendar.Period.
arg_1 - (CAL type: Cal.Data.BusinessCalendar.Period)
Cal.Data.BusinessCalendar.PeriodType)public static final SourceModel.Expr getBasePeriodValue(SourceModel.Expr arg_1)
Cal.Data.BusinessCalendar.PeriodType
in the Cal.Data.BusinessCalendar.Period.
Throws an error if there are no values in the Cal.Data.BusinessCalendar.Period.
arg_1 - (CAL type: Cal.Data.BusinessCalendar.Period)
Cal.Core.Prelude.Int)
public static final SourceModel.Expr getChildPeriodValues(SourceModel.Expr businessCalendar,
SourceModel.Expr parentPeriod,
SourceModel.Expr periodType,
SourceModel.Expr maybeMinValue,
SourceModel.Expr maybeMaxValue)
Cal.Data.BusinessCalendar.PeriodType in the given
Cal.Data.BusinessCalendar.Period. Optionally, endpoints may be specified to
limit the range.
For example, for the Cal.Data.BusinessCalendar.DayOfWeekPeriod period type,
this might return [(2, "Monday"), (4, "Wednesday"), (6, "Friday")].
For example, for the Cal.Data.BusinessCalendar.QuarterPeriod period type,
this might return [(1, "Q1 98"), (2, "Q2 98"), (3, "Q3 98"), (4, "Q4 98")].
businessCalendar - (CAL type: Cal.Data.BusinessCalendar.BusinessCalendar)parentPeriod - (CAL type: Cal.Data.BusinessCalendar.Period)periodType - (CAL type: Cal.Data.BusinessCalendar.PeriodType)maybeMinValue - (CAL type: Cal.Core.Prelude.Maybe Cal.Core.Prelude.Int)maybeMaxValue - (CAL type: Cal.Core.Prelude.Maybe Cal.Core.Prelude.Int)
[(Cal.Core.Prelude.Int, Cal.Core.Prelude.String)])
public static final SourceModel.Expr getPeriodFromTime(SourceModel.Expr businessCalendar,
SourceModel.Expr time,
SourceModel.Expr periodTypes)
Cal.Data.BusinessCalendar.BusinessCalendar to convert a time
value into a Cal.Data.BusinessCalendar.Period with the specified
Cal.Data.BusinessCalendar.PeriodTypes.
businessCalendar - (CAL type: Cal.Data.BusinessCalendar.BusinessCalendar)time - (CAL type: Cal.Utilities.Time.Time)periodTypes - (CAL type: [Cal.Data.BusinessCalendar.PeriodType])
Cal.Data.BusinessCalendar.Period)
public static final SourceModel.Expr getPeriodTimeRange(SourceModel.Expr businessCalendar,
SourceModel.Expr period)
Cal.Data.BusinessCalendar.BusinessCalendar to determine the
time range corresponding to the given Cal.Data.BusinessCalendar.Period.
This is only possible if the Cal.Data.BusinessCalendar.YearPeriod period is
included in the period.
If the info cannot be determined for this period, then the range returned
will not be bounded on either end.
businessCalendar - (CAL type: Cal.Data.BusinessCalendar.BusinessCalendar)period - (CAL type: Cal.Data.BusinessCalendar.Period)
Cal.Utilities.Range.Range Cal.Utilities.Time.Time)public static final SourceModel.Expr getPeriodTypeName(SourceModel.Expr periodType)
Cal.Data.BusinessCalendar.PeriodType.
periodType - (CAL type: Cal.Data.BusinessCalendar.PeriodType)
Cal.Core.Prelude.String)
public static final SourceModel.Expr getPeriodValue(SourceModel.Expr period,
SourceModel.Expr periodType)
Cal.Data.BusinessCalendar.PeriodType in
the Cal.Data.BusinessCalendar.Period.
If the Cal.Data.BusinessCalendar.Period does not include this
Cal.Data.BusinessCalendar.PeriodType, then Cal.Core.Prelude.Nothing
will be returned.
TODO: should this function attempt to calculate the value if it is not available? (e.g. Quarter if Year and Month are present.)
period - (CAL type: Cal.Data.BusinessCalendar.Period)periodType - (CAL type: Cal.Data.BusinessCalendar.PeriodType)
Cal.Core.Prelude.Maybe Cal.Core.Prelude.Int)
public static final SourceModel.Expr getPeriodValueFromTime(SourceModel.Expr businessCalendar,
SourceModel.Expr time,
SourceModel.Expr periodType)
Cal.Data.BusinessCalendar.BusinessCalendar to determine the
value of a given Cal.Data.BusinessCalendar.PeriodType for the specified time.
businessCalendar - (CAL type: Cal.Data.BusinessCalendar.BusinessCalendar)time - (CAL type: Cal.Utilities.Time.Time)periodType - (CAL type: Cal.Data.BusinessCalendar.PeriodType)
Cal.Core.Prelude.Int)
public static final SourceModel.Expr getPeriodValueRange(SourceModel.Expr businessCalendar,
SourceModel.Expr parentPeriod,
SourceModel.Expr periodType)
Cal.Data.BusinessCalendar.BusinessCalendar to determine
what range of values are possible for a specified Cal.Data.BusinessCalendar.PeriodType
within a specified Cal.Data.BusinessCalendar.Period.
businessCalendar - (CAL type: Cal.Data.BusinessCalendar.BusinessCalendar)parentPeriod - (CAL type: Cal.Data.BusinessCalendar.Period)periodType - (CAL type: Cal.Data.BusinessCalendar.PeriodType)
(Cal.Core.Prelude.Int, Cal.Core.Prelude.Int))public static final SourceModel.Expr getPeriodValues(SourceModel.Expr period)
Cal.Data.BusinessCalendar.PeriodType-value pairs for the
Cal.Data.BusinessCalendar.Period.
The pairs are in nesting order, with the outermost
Cal.Data.BusinessCalendar.PeriodType at the beginning of the list.
period - (CAL type: Cal.Data.BusinessCalendar.Period)
[(Cal.Data.BusinessCalendar.PeriodType, Cal.Core.Prelude.Int)])
public static final SourceModel.Expr getTimePartExpr(SourceModel.Expr businessCalendar,
SourceModel.Expr baseTimeExpr,
SourceModel.Expr periodType)
Cal.Data.BusinessCalendar.BusinessCalendar to determine the
database expression to extract the value of the Cal.Data.BusinessCalendar.PeriodType
from the specified time expression.
businessCalendar - (CAL type: Cal.Data.BusinessCalendar.BusinessCalendar)baseTimeExpr - (CAL type: Cal.Data.DictionaryQuery.Expr)periodType - (CAL type: Cal.Data.BusinessCalendar.PeriodType)
Cal.Data.DictionaryQuery.Expr)
public static final SourceModel.Expr getValidBasePeriodValues(SourceModel.Expr businessCalendar,
SourceModel.Expr period)
Cal.Data.BusinessCalendar.BusinessCalendar to determine the
range of possible values for the base Cal.Data.BusinessCalendar.PeriodType
of a Cal.Data.BusinessCalendar.Period.
businessCalendar - (CAL type: Cal.Data.BusinessCalendar.BusinessCalendar)period - (CAL type: Cal.Data.BusinessCalendar.Period)
(Cal.Core.Prelude.Int, Cal.Core.Prelude.Int))public static final SourceModel.Expr getValidChildTimePeriods(SourceModel.Expr parentPeriod)
Cal.Data.BusinessCalendar.PeriodType values
which can roll up into the specified parent Cal.Data.BusinessCalendar.PeriodType.
parentPeriod - (CAL type: Cal.Data.BusinessCalendar.PeriodType)
[Cal.Data.BusinessCalendar.PeriodType])public static final SourceModel.Expr getValidParentTimePeriods(SourceModel.Expr childPeriod)
Cal.Data.BusinessCalendar.PeriodType values
into which a child Cal.Data.BusinessCalendar.PeriodType can roll up.
childPeriod - (CAL type: Cal.Data.BusinessCalendar.PeriodType)
[Cal.Data.BusinessCalendar.PeriodType])public static final SourceModel.Expr intToPeriodType(SourceModel.Expr intVal)
Cal.Data.BusinessCalendar.PeriodType corresponding to a given ordinal.
intVal - (CAL type: Cal.Core.Prelude.Int)
Cal.Data.BusinessCalendar.PeriodType)
The corresponding Cal.Data.BusinessCalendar.PeriodType if one exists, or
Cal.Data.BusinessCalendar.NoPeriod otherwise.public static final SourceModel.Expr intToPeriodType(int intVal)
intVal -
intToPeriodType(org.openquark.cal.compiler.SourceModel.Expr)
public static final SourceModel.Expr makeBusinessCalendar(SourceModel.Expr periodValueRangeFn,
SourceModel.Expr periodDisplayNameFn,
SourceModel.Expr periodTimeRangeFn,
SourceModel.Expr periodValueFromTimeFn,
SourceModel.Expr timePartExprFn)
Cal.Data.BusinessCalendar.BusinessCalendar with the specified behavior.
periodValueRangeFn - (CAL type: Cal.Data.BusinessCalendar.Period -> Cal.Data.BusinessCalendar.PeriodType -> (Cal.Core.Prelude.Int, Cal.Core.Prelude.Int))
a function to get the range of valid values for a specified period, given the parent periodperiodDisplayNameFn - (CAL type: Cal.Data.BusinessCalendar.Period -> Cal.Data.BusinessCalendar.PeriodType -> Cal.Core.Prelude.Int -> Cal.Core.Prelude.String)
a function to get the display name for a period valueperiodTimeRangeFn - (CAL type: Cal.Data.BusinessCalendar.Period -> Cal.Utilities.Range.Range Cal.Utilities.Time.Time)
a function to get the start and end time for for a specified periodperiodValueFromTimeFn - (CAL type: Cal.Utilities.Time.Time -> Cal.Data.BusinessCalendar.PeriodType -> Cal.Core.Prelude.Int)
a function to get the value of the specified period for a time valuetimePartExprFn - (CAL type: Cal.Data.DictionaryQuery.Expr -> Cal.Data.BusinessCalendar.PeriodType -> Cal.Data.DictionaryQuery.Expr)
a function to build a database expression to extract the appropriate time part from a time value
Cal.Data.BusinessCalendar.BusinessCalendar)
public static final SourceModel.Expr makeChildPeriod(SourceModel.Expr parentPeriod,
SourceModel.Expr childPeriodType,
SourceModel.Expr childPeriodValue)
Cal.Data.BusinessCalendar.Period from a containing
Cal.Data.BusinessCalendar.Period value.
The Cal.Data.BusinessCalendar.PeriodType is assumed to be able to nest
within the innermost Cal.Data.BusinessCalendar.PeriodType of the parent.
TODO: validate period nesting (i.e. order)?
parentPeriod - (CAL type: Cal.Data.BusinessCalendar.Period)childPeriodType - (CAL type: Cal.Data.BusinessCalendar.PeriodType)childPeriodValue - (CAL type: Cal.Core.Prelude.Int)
Cal.Data.BusinessCalendar.Period)
public static final SourceModel.Expr makeChildPeriod(SourceModel.Expr parentPeriod,
SourceModel.Expr childPeriodType,
int childPeriodValue)
parentPeriod - childPeriodType - childPeriodValue -
makeChildPeriod(org.openquark.cal.compiler.SourceModel.Expr, org.openquark.cal.compiler.SourceModel.Expr, org.openquark.cal.compiler.SourceModel.Expr)public static final SourceModel.Expr makePeriod(SourceModel.Expr periodValues)
Cal.Data.BusinessCalendar.Period from its
Cal.Data.BusinessCalendar.Period values.
The pairs are assumed to be in nesting order, with the outermost
Cal.Data.BusinessCalendar.PeriodType at the beginning of the list.
TODO: validate period nesting (i.e. order)?
periodValues - (CAL type: [(Cal.Data.BusinessCalendar.PeriodType, Cal.Core.Prelude.Int)])
Cal.Data.BusinessCalendar.Period)
public static final SourceModel.Expr periodDisplayName(SourceModel.Expr businessCalendar,
SourceModel.Expr parentPeriod,
SourceModel.Expr periodType,
SourceModel.Expr periodValue)
Cal.Data.BusinessCalendar.BusinessCalendar to determine the
display string of a given Cal.Data.BusinessCalendar.PeriodType and value
with a specified Cal.Data.BusinessCalendar.Period as context.
For example, depending on the Cal.Data.BusinessCalendar.BusinessCalendar,
for the Cal.Data.BusinessCalendar.DayOfWeekPeriod period type, this might return
"Monday". Similarly, for the Cal.Data.BusinessCalendar.QuarterPeriod
period type, this might return "Q1 98".
businessCalendar - (CAL type: Cal.Data.BusinessCalendar.BusinessCalendar)parentPeriod - (CAL type: Cal.Data.BusinessCalendar.Period)periodType - (CAL type: Cal.Data.BusinessCalendar.PeriodType)periodValue - (CAL type: Cal.Core.Prelude.Int)
Cal.Core.Prelude.String)
public static final SourceModel.Expr periodDisplayName(SourceModel.Expr businessCalendar,
SourceModel.Expr parentPeriod,
SourceModel.Expr periodType,
int periodValue)
businessCalendar - parentPeriod - periodType - periodValue -
periodDisplayName(org.openquark.cal.compiler.SourceModel.Expr, org.openquark.cal.compiler.SourceModel.Expr, org.openquark.cal.compiler.SourceModel.Expr, org.openquark.cal.compiler.SourceModel.Expr)public static final SourceModel.Expr periodTypeToInt(SourceModel.Expr periodType)
Cal.Data.BusinessCalendar.PeriodType.
periodType - (CAL type: Cal.Data.BusinessCalendar.PeriodType)
Cal.Core.Prelude.Int)
The corresponding ordinal.
public static final SourceModel.Expr setBasePeriodValue(SourceModel.Expr period,
SourceModel.Expr newBasePeriodValue)
Cal.Data.BusinessCalendar.PeriodType
in the Cal.Data.BusinessCalendar.Period.
Throws an error if there are no values in the Cal.Data.BusinessCalendar.Period.
period - (CAL type: Cal.Data.BusinessCalendar.Period)newBasePeriodValue - (CAL type: Cal.Core.Prelude.Int)
Cal.Data.BusinessCalendar.Period)
public static final SourceModel.Expr setBasePeriodValue(SourceModel.Expr period,
int newBasePeriodValue)
period - newBasePeriodValue -
setBasePeriodValue(org.openquark.cal.compiler.SourceModel.Expr, org.openquark.cal.compiler.SourceModel.Expr)
public static final SourceModel.Expr shiftByNPeriods(SourceModel.Expr businessCalendar,
SourceModel.Expr origPeriod,
SourceModel.Expr periodType,
SourceModel.Expr shiftAmount)
If this would cause the root period type in the period to go out of bounds,
then an error will be thrown. For example, for the period [Month, 10]
adding 5 to the Month period type would result in a month value of 15, which
is not possible.
If the root period type is Year, then this error should not occur.
If not shifting the base (lowest) period type in the period, then it is
possible that the lower-level values could become out of range. In this case,
they will be set to the nearest in-range value. For example, adding 1 Year
to [(Year 2004, Month 2(Feb), Day 29)] would give
[(Year 2005, Month 2(Feb), Day 28)].
Currently, this function will only work with period types explicitly included in the period.
TODO: it would probably be nice to handle ones which can be determined from lower level ones (quarters from months, etc...)...
TODO: does this handle the case where the child values need to change depending on the parent values? For example, for Year/Month/DayOfYear, shifting the month value should update the DayOfYear value as well.
businessCalendar - (CAL type: Cal.Data.BusinessCalendar.BusinessCalendar)origPeriod - (CAL type: Cal.Data.BusinessCalendar.Period)periodType - (CAL type: Cal.Data.BusinessCalendar.PeriodType)shiftAmount - (CAL type: Cal.Core.Prelude.Int)
Cal.Data.BusinessCalendar.Period)
public static final SourceModel.Expr shiftByNPeriods(SourceModel.Expr businessCalendar,
SourceModel.Expr origPeriod,
SourceModel.Expr periodType,
int shiftAmount)
businessCalendar - origPeriod - periodType - shiftAmount -
shiftByNPeriods(org.openquark.cal.compiler.SourceModel.Expr, org.openquark.cal.compiler.SourceModel.Expr, org.openquark.cal.compiler.SourceModel.Expr, org.openquark.cal.compiler.SourceModel.Expr)
|
![]() Quark Platform Documentation Version 1.7.1_0 Business Objects |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||