@Override public Bitmap xor(Bitmap other) { return new Ewah32BitmapWrapper(bitmap.xor(((Ewah32BitmapWrapper) other).bitmap)); }
EWAHCompressedBitmap32 x1 = pq.poll(); EWAHCompressedBitmap32 x2 = pq.poll(); pq.add(x1.xor(x2));
/** * Simple algorithm that computes the XOR aggregate. * * @param bitmaps input bitmaps * @return new bitmap containing the aggregate */ public static EWAHCompressedBitmap32 xor(final EWAHCompressedBitmap32... bitmaps) { PriorityQueue<EWAHCompressedBitmap32> pq = new PriorityQueue<EWAHCompressedBitmap32>(bitmaps.length, new Comparator<EWAHCompressedBitmap32>() { @Override public int compare(EWAHCompressedBitmap32 a, EWAHCompressedBitmap32 b) { return a.sizeInBytes() - b.sizeInBytes(); } } ); Collections.addAll(pq, bitmaps); if(pq.isEmpty()) return new EWAHCompressedBitmap32(); while (pq.size() > 1) { EWAHCompressedBitmap32 x1 = pq.poll(); EWAHCompressedBitmap32 x2 = pq.poll(); pq.add(x1.xor(x2)); } return pq.poll(); }
EWAHCompressedBitmap32 x1 = pq.poll(); EWAHCompressedBitmap32 x2 = pq.poll(); pq.add(x1.xor(x2));
/** * Simple algorithm that computes the XOR aggregate. * * @param bitmaps input bitmaps * @return new bitmap containing the aggregate */ public static EWAHCompressedBitmap32 xor(final Iterator<EWAHCompressedBitmap32> bitmaps) { PriorityQueue<EWAHCompressedBitmap32> pq = new PriorityQueue<EWAHCompressedBitmap32>(32, new Comparator<EWAHCompressedBitmap32>() { @Override public int compare(EWAHCompressedBitmap32 a, EWAHCompressedBitmap32 b) { return a.sizeInBytes() - b.sizeInBytes(); } } ); while(bitmaps.hasNext()) pq.add(bitmaps.next()); if(pq.isEmpty()) return new EWAHCompressedBitmap32(); while (pq.size() > 1) { EWAHCompressedBitmap32 x1 = pq.poll(); EWAHCompressedBitmap32 x2 = pq.poll(); pq.add(x1.xor(x2)); } return pq.poll(); }
/** * Simple algorithm that computes the XOR aggregate. * * @param bitmaps input bitmaps * @return new bitmap containing the aggregate */ public static EWAHCompressedBitmap32 xor(final EWAHCompressedBitmap32... bitmaps) { PriorityQueue<EWAHCompressedBitmap32> pq = new PriorityQueue<EWAHCompressedBitmap32>(bitmaps.length, new Comparator<EWAHCompressedBitmap32>() { @Override public int compare(EWAHCompressedBitmap32 a, EWAHCompressedBitmap32 b) { return a.sizeInBytes() - b.sizeInBytes(); } } ); Collections.addAll(pq, bitmaps); if(pq.isEmpty()) return new EWAHCompressedBitmap32(); while (pq.size() > 1) { EWAHCompressedBitmap32 x1 = pq.poll(); EWAHCompressedBitmap32 x2 = pq.poll(); pq.add(x1.xor(x2)); } return pq.poll(); }
/** * Simple algorithm that computes the XOR aggregate. * * @param bitmaps input bitmaps * @return new bitmap containing the aggregate */ public static EWAHCompressedBitmap32 xor(final Iterator<EWAHCompressedBitmap32> bitmaps) { PriorityQueue<EWAHCompressedBitmap32> pq = new PriorityQueue<EWAHCompressedBitmap32>(32, new Comparator<EWAHCompressedBitmap32>() { @Override public int compare(EWAHCompressedBitmap32 a, EWAHCompressedBitmap32 b) { return a.sizeInBytes() - b.sizeInBytes(); } } ); while(bitmaps.hasNext()) pq.add(bitmaps.next()); if(pq.isEmpty()) return new EWAHCompressedBitmap32(); while (pq.size() > 1) { EWAHCompressedBitmap32 x1 = pq.poll(); EWAHCompressedBitmap32 x2 = pq.poll(); pq.add(x1.xor(x2)); } return pq.poll(); }