/** * 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 IteratingRLW32 bufferedxor(final int bufSize, final IteratingRLW32... al) { if (al.length == 0) throw new IllegalArgumentException( "Need at least one iterator"); if (al.length == 1) return al[0]; final LinkedList<IteratingRLW32> basell = new LinkedList<IteratingRLW32>(); Collections.addAll(basell, al); return new BufferedIterator32(new XORIt(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 and aggregate */ public static IteratingRLW32 bufferedand(final int bufSize, final IteratingRLW32... al) { if (al.length == 0) throw new IllegalArgumentException( "Need at least one iterator"); if (al.length == 1) return al[0]; final LinkedList<IteratingRLW32> basell = new LinkedList<IteratingRLW32>(); Collections.addAll(basell, al); return new BufferedIterator32(new AndIt(basell, bufSize)); }
@Override public void discardLiteralWords(int 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 or aggregate */ public static IteratingRLW32 bufferedor(final int bufSize, final IteratingRLW32... al) { if (al.length == 0) throw new IllegalArgumentException( "Need at least one iterator"); if (al.length == 1) return al[0]; final LinkedList<IteratingRLW32> basell = new LinkedList<IteratingRLW32>(); Collections.addAll(basell, al); return new BufferedIterator32(new ORIt(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 IteratingRLW32 bufferedor(final int bufSize, final IteratingRLW32... al) { if (al.length == 0) throw new IllegalArgumentException( "Need at least one iterator"); if (al.length == 1) return al[0]; final LinkedList<IteratingRLW32> basell = new LinkedList<IteratingRLW32>(); Collections.addAll(basell, al); return new BufferedIterator32(new ORIt(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(int x) { while (x > 0) { if (this.iteratingBrlw.getRunningLength() > x) { this.iteratingBrlw.discardFirstWords(x); return; } this.iteratingBrlw.discardFirstWords(this.iteratingBrlw.getRunningLength()); x -= this.iteratingBrlw.getRunningLength(); int 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 iterators to aggregate * @param bufSize size of the internal buffer used by the iterator in * 64-bit words * @return and aggregate */ public static IteratingRLW32 bufferedand(final int bufSize, final IteratingRLW32... al) { if (al.length == 0) throw new IllegalArgumentException( "Need at least one iterator"); if (al.length == 1) return al[0]; final LinkedList<IteratingRLW32> basell = new LinkedList<IteratingRLW32>(); Collections.addAll(basell, al); return new BufferedIterator32(new AndIt(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(int x) { while (x > 0) { if (this.iteratingBrlw.getRunningLength() > x) { this.iteratingBrlw.discardFirstWords(x); return; } this.iteratingBrlw.discardFirstWords(this.iteratingBrlw.getRunningLength()); x -= this.iteratingBrlw.getRunningLength(); int 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 iterators to aggregate * @param bufSize size of the internal buffer used by the iterator in * 64-bit words * @return xor aggregate */ public static IteratingRLW32 bufferedxor(final int bufSize, final IteratingRLW32... al) { if (al.length == 0) throw new IllegalArgumentException( "Need at least one iterator"); if (al.length == 1) return al[0]; final LinkedList<IteratingRLW32> basell = new LinkedList<IteratingRLW32>(); Collections.addAll(basell, al); return new BufferedIterator32(new XORIt(basell, bufSize)); }