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()
BasePeriodPattern
getSize
in interface BasePeriodPattern
public long makeIndex(long time) throws T2Exception
BasePeriodPattern
makeIndex
in interface BasePeriodPattern
time
- an unrestricted numerical time indexT2Exception
public long expandIndex(long time)
BasePeriodPattern
expandIndex
in interface BasePeriodPattern
time
- a compressed numerical time indexpublic boolean effective()
BasePeriodPattern
effective
in interface BasePeriodPattern
public boolean matches(boolean[] pattern)
pattern
- another sequence of true and false valuesCopyright © 2017. All rights reserved.