/** * Aggregate the iterators using a bitmap buffer. * * @param al iterators to aggregate * @param bufSize size of the internal buffer used by the iterator in 64-bit words * @return xor aggregate */ public static IteratingRLW bufferedxor(final int bufSize, final IteratingRLW... al) { if (al.length == 0) throw new IllegalArgumentException("Need at least one iterator"); if (al.length == 1) return al[0]; final LinkedList<IteratingRLW> basell = new LinkedList<IteratingRLW>(); Collections.addAll(basell, al); return new BufferedIterator(new BufferedXORIterator(basell, bufSize)); }
@Override public void discardLiteralWords(long x) { this.iteratingBrlw.discardLiteralWords(x); if (this.iteratingBrlw.getNumberOfLiteralWords() == 0) this.next(); }
/** * Aggregate the iterators using a bitmap buffer. * * @param al iterators to aggregate * @param bufSize size of the internal buffer used by the iterator in 64-bit words * @return xor aggregate */ public static IteratingRLW bufferedxor(final int bufSize, final IteratingRLW... al) { if (al.length == 0) throw new IllegalArgumentException("Need at least one iterator"); if (al.length == 1) return al[0]; final LinkedList<IteratingRLW> basell = new LinkedList<IteratingRLW>(); Collections.addAll(basell, al); return new BufferedIterator(new BufferedXORIterator(basell, bufSize)); }
@Override public void discardRunningWords() { this.iteratingBrlw.discardRunningWords(); if (this.iteratingBrlw.getNumberOfLiteralWords() == 0) this.next(); }
/** * Aggregate the iterators using a bitmap buffer. * * @param al set of iterators to aggregate * @param bufSize size of the internal buffer used by the iterator in * 64-bit words (per input iterator) * @return and aggregate */ public static IteratingRLW bufferedand(final int bufSize, final IteratingRLW... al) { if (al.length == 0) throw new IllegalArgumentException("Need at least one iterator"); if (al.length == 1) return al[0]; final LinkedList<IteratingRLW> basell = new LinkedList<IteratingRLW>(); Collections.addAll(basell, al); return new BufferedIterator(new BufferedAndIterator(basell, bufSize)); }
@Override public void discardRunningWords() { this.iteratingBrlw.discardRunningWords(); if (this.iteratingBrlw.getNumberOfLiteralWords() == 0) this.next(); }
/** * Aggregate the iterators using a bitmap buffer. * * @param al iterators to aggregate * @param bufSize size of the internal buffer used by the iterator in * 64-bit words * @return or aggregate */ public static IteratingRLW bufferedor(final int bufSize, final IteratingRLW... al) { if (al.length == 0) throw new IllegalArgumentException("Need at least one iterator"); if (al.length == 1) return al[0]; final LinkedList<IteratingRLW> basell = new LinkedList<IteratingRLW>(); Collections.addAll(basell, al); return new BufferedIterator(new BufferedORIterator(basell, bufSize)); }
/** * Discard first words, iterating to the next running length word if * needed. * * @param x the number of words to be discarded */ @Override public void discardFirstWords(long x) { while (x > 0) { if (this.iteratingBrlw.getRunningLength() > x) { this.iteratingBrlw.discardFirstWords(x); return; } this.iteratingBrlw.discardFirstWords(this.iteratingBrlw.getRunningLength()); x -= this.iteratingBrlw.getRunningLength(); long toDiscard = x > this.iteratingBrlw.getNumberOfLiteralWords() ? this.iteratingBrlw.getNumberOfLiteralWords() : x; this.iteratingBrlw.discardFirstWords(toDiscard); x -= toDiscard; if ((x > 0) || (this.iteratingBrlw.size() == 0)) { if (!this.next()) { break; } } } } @Override
/** * Aggregate the iterators using a bitmap buffer. * * @param al iterators to aggregate * @param bufSize size of the internal buffer used by the iterator in * 64-bit words * @return or aggregate */ public static IteratingRLW bufferedor(final int bufSize, final IteratingRLW... al) { if (al.length == 0) throw new IllegalArgumentException("Need at least one iterator"); if (al.length == 1) return al[0]; final LinkedList<IteratingRLW> basell = new LinkedList<IteratingRLW>(); Collections.addAll(basell, al); return new BufferedIterator(new BufferedORIterator(basell, bufSize)); }
/** * Discard first words, iterating to the next running length word if * needed. * * @param x the number of words to be discarded */ @Override public void discardFirstWords(long x) { while (x > 0) { if (this.iteratingBrlw.getRunningLength() > x) { this.iteratingBrlw.discardFirstWords(x); return; } this.iteratingBrlw.discardFirstWords(this.iteratingBrlw.getRunningLength()); x -= this.iteratingBrlw.getRunningLength(); long toDiscard = x > this.iteratingBrlw.getNumberOfLiteralWords() ? this.iteratingBrlw.getNumberOfLiteralWords() : x; this.iteratingBrlw.discardFirstWords(toDiscard); x -= toDiscard; if ((x > 0) || (this.iteratingBrlw.size() == 0)) { if (!this.next()) { break; } } } }
/** * Aggregate the iterators using a bitmap buffer. * * @param al set of iterators to aggregate * @param bufSize size of the internal buffer used by the iterator in * 64-bit words (per input iterator) * @return and aggregate */ public static IteratingRLW bufferedand(final int bufSize, final IteratingRLW... al) { if (al.length == 0) throw new IllegalArgumentException("Need at least one iterator"); if (al.length == 1) return al[0]; final LinkedList<IteratingRLW> basell = new LinkedList<IteratingRLW>(); Collections.addAll(basell, al); return new BufferedIterator(new BufferedAndIterator(basell, bufSize)); }