public class Cycle extends Object implements BasePeriodPattern
BasePeriodPattern with a repeating sequence of ON and
OFF time points. A cycle is defined using a boolean array.| Constructor and Description |
|---|
Cycle(boolean... pattern)
Construct a cycle using the given pattern.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
effective()
Return true it the primary pattern has any effect.
|
boolean |
equals(Object obj) |
long |
expandIndex(long time)
Put back all removed OFF time points in a compressed numerical time index.
|
int |
getSize()
Return the number of time points in the pattern.
|
int |
hashCode() |
long |
makeIndex(long time)
Compress an unrestricted numerical time index by removing all OFF time points.
|
boolean |
matches(boolean[] pattern)
Return true if the given pattern equals this pattern.
|
String |
toString() |
public Cycle(boolean... pattern)
pattern - a sequence of true and false valuespublic int getSize()
BasePeriodPatterngetSize in interface BasePeriodPatternpublic long makeIndex(long time)
throws T2Exception
BasePeriodPatternmakeIndex in interface BasePeriodPatterntime - an unrestricted numerical time indexT2Exceptionpublic long expandIndex(long time)
BasePeriodPatternexpandIndex in interface BasePeriodPatterntime - a compressed numerical time indexpublic boolean effective()
BasePeriodPatterneffective in interface BasePeriodPatternpublic boolean matches(boolean[] pattern)
pattern - another sequence of true and false valuesCopyright © 2017. All rights reserved.