@Override public long next() { if ( !hasNext() ) { throw new NoSuchElementException( forward ? format( "ID [%s] has exceeded the high ID [%s] of %s.", id, targetId, store ) : format( "ID [%s] has exceeded the low ID [%s] of %s.", id, targetId, store ) ); } try { return id; } finally { id += forward ? 1 : -1; } } }
@Override public long next() { if ( !hasNext() ) { throw new NoSuchElementException( forward ? format( "ID [%s] has exceeded the high ID [%s] of %s.", id, targetId, store ) : format( "ID [%s] has exceeded the low ID [%s] of %s.", id, targetId, store ) ); } try { return id; } finally { id += forward ? 1 : -1; } } }