/** * @return <code>true</code> if this Clock occurred after the specified Clock <code>c</code>. * Otherwise, <code>false</code>. */ public boolean after(Clock c) { return compareTo(c) == Occurred.AFTER; }
/** * @return <code>true</code> if this Clock is equal to or occurred after the specified Clock <code>c</code>. * Otherwise, <code>false</code>. */ public boolean afterEqual(Clock c) { Occurred o = compareTo(c); return o == Occurred.AFTER || o == Occurred.EQUICONCURRENTLY; }
/** * @return <code>true</code> if this Clock occurred before the specified Clock <code>c</code>. * Otherwise, <code>false</code>. */ public boolean before(Clock c) { return compareTo(c) == Occurred.BEFORE; }
/** * @return <code>true</code> if this Clock is equal to or occurred before the specified Clock <code>c</code>. * Otherwise, <code>false</code>. */ public boolean beforeEqual(Clock c) { Occurred o = compareTo(c); return o == Occurred.BEFORE || o == Occurred.EQUICONCURRENTLY; }
/** * @return <code>true</code> if this Clock occurred before the specified Clock <code>c</code>. * Otherwise, <code>false</code>. */ public boolean before(Clock c) { return compareTo(c) == Occurred.BEFORE; }
/** * @return <code>true</code> if this Clock occurred after the specified Clock <code>c</code>. * Otherwise, <code>false</code>. */ public boolean after(Clock c) { return compareTo(c) == Occurred.AFTER; }
/** * @return <code>true</code> if this Clock is equal to or occurred before the specified Clock <code>c</code>. * Otherwise, <code>false</code>. */ public boolean beforeEqual(Clock c) { Occurred o = compareTo(c); return o == Occurred.BEFORE || o == Occurred.EQUICONCURRENTLY; }
/** * @return <code>true</code> if this Clock is equal to or occurred after the specified Clock <code>c</code>. * Otherwise, <code>false</code>. */ public boolean afterEqual(Clock c) { Occurred o = compareTo(c); return o == Occurred.AFTER || o == Occurred.EQUICONCURRENTLY; }
@Override public long getOffset(Clock sinceClock) { if(_minClock.before(sinceClock) && !sinceClock.after(_maxClock)) { int i = 0; for(; i < _events.size(); i++) { Event<T> e = _events.get(i); Occurred occ = sinceClock.compareTo(e.getClock()); if(occ == Occurred.EQUICONCURRENTLY) { break; } else if(occ == Occurred.BEFORE || occ == Occurred.CONCURRENTLY) { i--; break; } } return _origin + i; } return -1; }
@Override public long getOffset(Clock sinceClock) { if(_minClock.before(sinceClock) && !sinceClock.after(_maxClock)) { int i = 0; for(; i < _events.size(); i++) { Event<T> e = _events.get(i); Occurred occ = sinceClock.compareTo(e.getClock()); if(occ == Occurred.EQUICONCURRENTLY) { break; } else if(occ == Occurred.BEFORE || occ == Occurred.CONCURRENTLY) { i--; break; } } return _origin + i; } return -1; }
long sinceOffset; Occurred occ = sinceClock.compareTo(getMinClock()); if(occ == Occurred.EQUICONCURRENTLY) { return new SimplePosition(getId(), getOrigin(), getMinClock()); if(b2 != null) { if(b2.getMaxClock().before(sinceClock)) { if(b1.getMinClock().compareTo(sinceClock) == Occurred.EQUICONCURRENTLY) { return new SimplePosition(getId(), b1.getOrigin(), b1.getMinClock()); } else { EventBatchHeader h = c.getHeader(); occ = h.getMinClock().compareTo(sinceClock); if(occ == Occurred.EQUICONCURRENTLY) { if(cnt == 0) {
long sinceOffset; Occurred occ = sinceClock.compareTo(getMinClock()); if(occ == Occurred.EQUICONCURRENTLY) { return new SimplePosition(getId(), getOrigin(), getMinClock()); if(b2 != null) { if(b2.getMaxClock().before(sinceClock)) { if(b1.getMinClock().compareTo(sinceClock) == Occurred.EQUICONCURRENTLY) { return new SimplePosition(getId(), b1.getOrigin(), b1.getMinClock()); } else { EventBatchHeader h = c.getHeader(); occ = h.getMinClock().compareTo(sinceClock); if(occ == Occurred.EQUICONCURRENTLY) { if(cnt == 0) {