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 definitionsT2Exception
public int getSize()
SubPeriodPattern
getSize
in interface SubPeriodPattern
public Resolution getSubPeriod()
SubPeriodPattern
getSubPeriod
in interface SubPeriodPattern
public Resolution getBasePeriod()
SubPeriodPattern
getBasePeriod
in interface SubPeriodPattern
public long adjustForSubPeriod(long time, Adjustment adjust, TimeParts tp) throws T2Exception
SubPeriodPattern
TimePacker.pack(TimeParts, Adjustment)
.adjustForSubPeriod
in interface SubPeriodPattern
time
- a numeric time indexadjust
- an allowed adjustment modetp
- a time parts object with the complete time specificationT2Exception
public TimeParts fillInSubPeriod(int subPeriod, TimeParts tp)
SubPeriodPattern
TimePacker.unpack(long)
.fillInSubPeriod
in interface SubPeriodPattern
subPeriod
- a positive numbertp
- a time parts object to be modifiedCopyright © 2017. All rights reserved.