@NotThreadSafe public final class ElapsedSync extends Sync.Abstract
Instances of this class can be used to prepare store queries on a fixed interval starting from an arbitrary time stamp.
Sync.Abstract
CRONTAB_PARAM, ELAPSED_PARAM, OFFSET_PARAM, STAMP_PARAM, TIME_ZONE_PARAM
Constructor and Description |
---|
ElapsedSync()
Constructs an instance.
|
ElapsedSync(ElapsedTime elapsed,
Optional<ElapsedTime> offset)
Constructs an instance.
|
ElapsedSync(String elapsed,
Optional<String> offset)
Constructs an instance.
|
ElapsedSync(ZoneId zoneId,
ElapsedTime elapsed,
Optional<ElapsedTime> offset)
Constructs an instance.
|
ElapsedSync(ZoneId zoneId,
String elapsed,
Optional<String> offset)
Constructs an instance.
|
Modifier and Type | Method and Description |
---|---|
Sync |
copy()
Creates a copy of this.
|
boolean |
equals(Object object) |
Optional<DateTime> |
getNextStamp()
Gets the next time stamp.
|
Optional<DateTime> |
getNextStamp(int intervals)
Gets the next time stamp separated by a number of intervals.
|
Optional<DateTime> |
getPreviousStamp()
Gets the previous time stamp.
|
Optional<DateTime> |
getPreviousStamp(int intervals)
Gets the previous time stamp separated by a number of intervals.
|
int |
hashCode() |
boolean |
isInSync()
Asks if the current time stamp is in sync.
|
void |
readExternal(ObjectInput input) |
void |
setLimits(TimeInterval limits)
Sets the limits.
|
boolean |
setUp(Params params)
Sets up this sync.
|
void |
tearDown()
Tears down what has been set up.
|
String |
toString() |
void |
writeExternal(ObjectOutput output) |
checkNotFrozen, freeze, getCurrentStamp, getDefaultLimits, getFirstStamp, getLastStamp, getLimits, getNextStamp, getNextStamp, getPreviousStamp, getPreviousStamp, getThisLogger, getZoneId, isBounded, isInSync, iterator, iterator, nextStamp, previousStamp, reverseIterator, reverseIterator, seed, setCurrentStamp, setZoneId
public ElapsedSync()
Needed for dynamic instantiation.
public ElapsedSync(@Nonnull ElapsedTime elapsed, @Nonnull Optional<ElapsedTime> offset)
elapsed
- An elapsed time.offset
- An optional time offset.public ElapsedSync(@Nonnull String elapsed, @Nonnull Optional<String> offset)
elapsed
- An elapsed time representation.offset
- An optional time offset representation.public ElapsedSync(@Nonnull ZoneId zoneId, @Nonnull ElapsedTime elapsed, @Nonnull Optional<ElapsedTime> offset)
zoneId
- The zone id.elapsed
- An elapsed time.offset
- An optional time offset.public ElapsedSync(@Nonnull ZoneId zoneId, @Nonnull String elapsed, @Nonnull Optional<String> offset)
zoneId
- The zone id.elapsed
- An elapsed time representation.offset
- A time offset representation.public Sync copy()
public boolean equals(Object object)
equals
in class Object
public Optional<DateTime> getNextStamp()
public Optional<DateTime> getNextStamp(int intervals)
getNextStamp
in interface Sync
getNextStamp
in class Sync.Abstract
intervals
- A number of intervals.public Optional<DateTime> getPreviousStamp()
public Optional<DateTime> getPreviousStamp(int intervals)
getPreviousStamp
in interface Sync
getPreviousStamp
in class Sync.Abstract
intervals
- A number of intervals.public int hashCode()
hashCode
in class Object
public boolean isInSync()
public void readExternal(ObjectInput input) throws IOException
readExternal
in interface Externalizable
readExternal
in class Sync.Abstract
IOException
public void setLimits(TimeInterval limits)
setLimits
in interface Sync
setLimits
in class Sync.Abstract
limits
- The limits.public boolean setUp(Params params)
setUp
in class Sync.Abstract
params
- The sync params.public void tearDown()
tearDown
in class Sync.Abstract
public String toString()
toString
in class Sync.Abstract
public void writeExternal(ObjectOutput output) throws IOException
writeExternal
in interface Externalizable
writeExternal
in class Sync.Abstract
IOException
Copyright © 2003-2019 Serge Brisson. All Rights Reserved.