public abstract static class Sync.Abstract extends Object implements Sync, Externalizable
Sync.Abstract
CRONTAB_PARAM, ELAPSED_PARAM, OFFSET_PARAM, STAMP_PARAM, TIME_ZONE_PARAM
Modifier | Constructor and Description |
---|---|
protected |
Abstract()
Constructs an instance.
|
protected |
Abstract(Sync.Abstract other)
Constructs an instance from an other.
|
protected |
Abstract(ZoneId zoneId)
Constructs an instance.
|
Modifier and Type | Method and Description |
---|---|
protected void |
checkNotFrozen()
Checks that the sync is not frozen.
|
protected void |
freeze()
Freezes.
|
DateTime |
getCurrentStamp()
Gets the current stamp.
|
TimeInterval |
getDefaultLimits()
Gets the default limits.
|
DateTime |
getFirstStamp()
Gets the first stamp.
|
DateTime |
getLastStamp()
Gets the last stamp.
|
TimeInterval |
getLimits()
Gets the limits.
|
Optional<DateTime> |
getNextStamp(DateTime stamp)
Gets the next time stamp.
|
Optional<DateTime> |
getNextStamp(DateTime stamp,
int intervals)
Gets the next time stamp separated by a number of intervals.
|
Optional<DateTime> |
getNextStamp(int intervals)
Gets the next time stamp separated by a number of intervals.
|
Optional<DateTime> |
getPreviousStamp(DateTime stamp)
Gets the previous time stamp.
|
Optional<DateTime> |
getPreviousStamp(DateTime stamp,
int intervals)
Gets the previous time stamp separated by a number of intervals.
|
Optional<DateTime> |
getPreviousStamp(int intervals)
Gets the previous time stamp separated by a number of intervals.
|
protected Logger |
getThisLogger()
Gets the logger.
|
protected ZoneId |
getZoneId()
Gets the zone id.
|
boolean |
isBounded()
Returns true if the limits are inside BoT to EoT.
|
boolean |
isInSync(DateTime stamp)
Asks if the reference time stamp is in sync.
|
ListIterator<DateTime> |
iterator()
Returns an iterator.
|
ListIterator<DateTime> |
iterator(DateTime stamp)
Returns an iterator.
|
protected Optional<DateTime> |
nextStamp()
Returns the next stamp.
|
protected Optional<DateTime> |
previousStamp()
Returns the previous stamp.
|
void |
readExternal(ObjectInput input) |
ListIterator<DateTime> |
reverseIterator()
Returns a reverse iterator.
|
ListIterator<DateTime> |
reverseIterator(DateTime stamp)
Returns a reverse iterator.
|
void |
seed(DateTime stamp)
Seeds the time stamp.
|
protected void |
setCurrentStamp(DateTime stamp,
int direction)
Sets the current stamp.
|
void |
setLimits(TimeInterval limits)
Sets the limits.
|
boolean |
setUp(Params params)
Sets up this sync.
|
protected void |
setZoneId(ZoneId zoneId)
Sets the zone id.
|
void |
tearDown()
Tears down what has been set up.
|
String |
toString() |
void |
writeExternal(ObjectOutput output) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
copy, getNextStamp, getPreviousStamp, isInSync
protected Abstract()
protected Abstract(@Nonnull Sync.Abstract other)
other
- The other instance.protected Abstract(@Nonnull ZoneId zoneId)
zoneId
- The zone id.public final DateTime getCurrentStamp()
getCurrentStamp
in interface Sync
public TimeInterval getDefaultLimits()
getDefaultLimits
in interface Sync
public DateTime getFirstStamp()
getFirstStamp
in interface Sync
public DateTime getLastStamp()
getLastStamp
in interface Sync
public final TimeInterval getLimits()
public final Optional<DateTime> getNextStamp(DateTime stamp)
getNextStamp
in interface Sync
stamp
- The reference time stamp.public Optional<DateTime> getNextStamp(int intervals)
getNextStamp
in interface Sync
intervals
- A number of intervals.public final Optional<DateTime> getNextStamp(DateTime stamp, int intervals)
getNextStamp
in interface Sync
stamp
- The reference time stamp.intervals
- A number of intervals.public final Optional<DateTime> getPreviousStamp(DateTime stamp)
getPreviousStamp
in interface Sync
stamp
- The reference time stamp.public Optional<DateTime> getPreviousStamp(int intervals)
getPreviousStamp
in interface Sync
intervals
- A number of intervals.public Optional<DateTime> getPreviousStamp(DateTime stamp, int intervals)
getPreviousStamp
in interface Sync
stamp
- The reference time stamp.intervals
- A number of intervals.public final boolean isBounded()
public final boolean isInSync(DateTime stamp)
public ListIterator<DateTime> iterator()
public void readExternal(ObjectInput input) throws IOException
readExternal
in interface Externalizable
IOException
public ListIterator<DateTime> reverseIterator()
reverseIterator
in interface Sync
public ListIterator<DateTime> reverseIterator(DateTime stamp)
reverseIterator
in interface Sync
stamp
- The initial stamp.public final void seed(DateTime stamp)
public void setLimits(TimeInterval limits)
@CheckReturnValue public boolean setUp(@Nonnull Params params)
params
- The sync params.public void tearDown()
public String toString()
toString
in class Object
public void writeExternal(ObjectOutput output) throws IOException
writeExternal
in interface Externalizable
IOException
protected final void checkNotFrozen()
protected final void freeze()
@Nonnull @CheckReturnValue protected final Logger getThisLogger()
@Nonnull @CheckReturnValue protected final ZoneId getZoneId()
@Nonnull @CheckReturnValue protected final Optional<DateTime> nextStamp()
@Nonnull @CheckReturnValue protected final Optional<DateTime> previousStamp()
protected final void setCurrentStamp(@Nonnull DateTime stamp, int direction)
stamp
- The stamp.direction
- The direction of the change (0 for don't care).protected final void setZoneId(@Nonnull ZoneId zoneId)
zoneId
- The zone id.Copyright © 2003-2019 Serge Brisson. All Rights Reserved.