public class SimpleSubPeriodPattern extends Object implements SubPeriodPattern
Constructor and Description |
---|
SimpleSubPeriodPattern(Resolution basePeriod,
Resolution subPeriod,
int[] ranks)
Construct a sub period pattern with the given base period and sub period resolutions, and with
the given 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 SimpleSubPeriodPattern(Resolution basePeriod, Resolution subPeriod, int[] ranks)
basePeriod
- a non-null resolutionsubPeriod
- a non-null resolutionranks
- a non-null non-empty array of integerspublic 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.