public class DayRankingSubPeriodPattern extends Object implements SubPeriodPattern
ThirdFriday. It
is possible to define more complex patterns.SimpleSubPeriodPattern| Constructor and Description |
|---|
DayRankingSubPeriodPattern(Resolution basePeriod,
DayByNameAndRank[] ranks)
Construct a sub period pattern for the given base period and ranks.
|
| Modifier and Type | Method and Description |
|---|---|
long |
adjustForSubPeriod(long time,
Adjustment adjust,
TimeParts tp)
Modify and return the numeric time index corresponding to the state of the
time parts argument.
|
boolean |
equals(Object obj) |
TimeParts |
fillInSubPeriod(int subPeriod,
TimeParts tp)
Update the relevant field of the time parts argument for the given sub period
and return a modified copy.
|
Resolution |
getBasePeriod()
Return the base period resolution.
|
int |
getSize()
Return the number of sub periods.
|
Resolution |
getSubPeriod()
Return the sub period resolution.
|
int |
hashCode() |
String |
toString() |
public DayRankingSubPeriodPattern(Resolution basePeriod, DayByNameAndRank[] ranks)
If any restriction is violated an IllegalArgumentException is
thrown.
basePeriod - a non-null resolution, yearly or monthlyranks - an array of day definitionsT2Exceptionpublic int getSize()
SubPeriodPatterngetSize in interface SubPeriodPatternpublic Resolution getSubPeriod()
SubPeriodPatterngetSubPeriod in interface SubPeriodPatternpublic Resolution getBasePeriod()
SubPeriodPatterngetBasePeriod in interface SubPeriodPatternpublic long adjustForSubPeriod(long time,
Adjustment adjust,
TimeParts tp)
throws T2Exception
SubPeriodPatternTimePacker.pack(TimeParts, Adjustment).adjustForSubPeriod in interface SubPeriodPatterntime - a numeric time indexadjust - an allowed adjustment modetp - a time parts object with the complete time specificationT2Exceptionpublic TimeParts fillInSubPeriod(int subPeriod, TimeParts tp)
SubPeriodPatternTimePacker.unpack(long).fillInSubPeriod in interface SubPeriodPatternsubPeriod - a positive numbertp - a time parts object to be modifiedCopyright © 2017. All rights reserved.