private void updateNext() { if(runningHasNext()) { if(this.nextBit == null || this.nextBit == this.runningBit) { this.nextBit = this.runningBit; int offset = runningOffset(); this.nextLength += offset; movePosition(offset); updateNext(); } } else if (literalHasNext()) { boolean b = currentWordBit(); if(this.nextBit == null || this.nextBit == b) { this.nextBit = b; this.nextLength++; movePosition(1); shiftWordMask(); updateNext(); } } else { moveToNextRLW(); } }
private boolean moveToNextRLW() { while (!runningHasNext() && !literalHasNext()) { if (!hasNextRLW()) { return this.nextBit!=null; } setRLW(nextRLW()); updateNext(); } return true; }
@Override public void move() { move(this.nextLength); }
@Override public void move(int bits) { this.nextLength -= bits; if(this.nextLength <= 0) { do { this.nextBit = null; updateNext(); this.hasNext = moveToNextRLW(); } while(this.nextLength <= 0 && this.hasNext); } }
private boolean literalHasNext() { while (this.word == 0 && this.wordMask == 0 && this.wordPosition < this.wordLength) { this.word = this.buffer.getWord(this.wordPosition++); this.wordMask = 1; } return (this.word != 0 || this.wordMask != 0 || !hasNextRLW()) && this.position < this.sizeInBits; }
ChunkIteratorImpl32(EWAHIterator32 ewahIter, int sizeInBits) { this.ewahIter = ewahIter; this.sizeInBits = sizeInBits; this.buffer = ewahIter.buffer(); this.hasNext = moveToNextRLW(); }
/** * Iterator over the chunk of bits. * * The current bitmap is not modified. * * @return the chunk iterator */ public ChunkIterator chunkIterator() { return new ChunkIteratorImpl32(this.getEWAHIterator(), this.sizeInBits); }
@Override public void move(int bits) { this.nextLength -= bits; if(this.nextLength <= 0) { do { this.nextBit = null; updateNext(); this.hasNext = moveToNextRLW(); } while(this.nextLength <= 0 && this.hasNext); } }
private boolean literalHasNext() { while (this.word == 0 && this.wordMask == 0 && this.wordPosition < this.wordLength) { this.word = this.buffer.getWord(this.wordPosition++); this.wordMask = 1; } return (this.word != 0 || this.wordMask != 0 || !hasNextRLW()) && this.position < this.sizeInBits; }
ChunkIteratorImpl32(EWAHIterator32 ewahIter, int sizeInBits) { this.ewahIter = ewahIter; this.sizeInBits = sizeInBits; this.buffer = ewahIter.buffer(); this.hasNext = moveToNextRLW(); }
/** * Iterator over the chunk of bits. * * The current bitmap is not modified. * * @return the chunk iterator */ public ChunkIterator chunkIterator() { return new ChunkIteratorImpl32(this.getEWAHIterator(), this.sizeInBits); }
private void updateNext() { if(runningHasNext()) { if(this.nextBit == null || this.nextBit == this.runningBit) { this.nextBit = this.runningBit; int offset = runningOffset(); this.nextLength += offset; movePosition(offset); updateNext(); } } else if (literalHasNext()) { boolean b = currentWordBit(); if(this.nextBit == null || this.nextBit == b) { this.nextBit = b; this.nextLength++; movePosition(1); shiftWordMask(); updateNext(); } } else { moveToNextRLW(); } }
private boolean moveToNextRLW() { while (!runningHasNext() && !literalHasNext()) { if (!hasNextRLW()) { return this.nextBit!=null; } setRLW(nextRLW()); updateNext(); } return true; }
@Override public void move() { move(this.nextLength); }