Examples of andNot()


Examples of java.util.BitSet.andNot()

            && (!sm.isFlushed() || sm.isFlushedDirty()))
            || (sm.getPCState() == PCState.PNEW && sm.isFlushedDirty())) {
            BitSet dirty = sm.getDirty();
            if (sm.isFlushed()) {
                dirty = (BitSet) dirty.clone();
                dirty.andNot(sm.getFlushed());
            }
            if (dirty.length() > 0)
                return dirty;
        }
        return null;
View Full Code Here

Examples of java.util.BitSet.andNot()

        assertEquals(a.cardinality(), b.cardinality());

        BitSet a_and = (BitSet)a.clone(); a_and.and(a0);
        BitSet a_or = (BitSet)a.clone(); a_or.or(a0);
        BitSet a_xor = (BitSet)a.clone(); a_xor.xor(a0);
        BitSet a_andn = (BitSet)a.clone(); a_andn.andNot(a0);

        OpenBitSet b_and = (OpenBitSet)b.clone(); assertEquals(b,b_and); b_and.and(b0);
        OpenBitSet b_or = (OpenBitSet)b.clone(); b_or.or(b0);
        OpenBitSet b_xor = (OpenBitSet)b.clone(); b_xor.xor(b0);
        OpenBitSet b_andn = (OpenBitSet)b.clone(); b_andn.andNot(b0);
View Full Code Here

Examples of java.util.BitSet.andNot()

   * @param peer The peer that became ready.
   */
  @Override
  public synchronized void handlePeerReady(SharingPeer peer) {
    BitSet interesting = peer.getAvailablePieces();
    interesting.andNot(this.completedPieces);
    interesting.andNot(this.requestedPieces);

    logger.trace("Peer {} is ready and has {} interesting piece(s).",
      peer, interesting.cardinality());

View Full Code Here

Examples of java.util.BitSet.andNot()

   */
  @Override
  public synchronized void handlePeerReady(SharingPeer peer) {
    BitSet interesting = peer.getAvailablePieces();
    interesting.andNot(this.completedPieces);
    interesting.andNot(this.requestedPieces);

    logger.trace("Peer {} is ready and has {} interesting piece(s).",
      peer, interesting.cardinality());

    // If we didn't find interesting pieces, we need to check if we're in
View Full Code Here

Examples of java.util.BitSet.andNot()

    // If we didn't find interesting pieces, we need to check if we're in
    // an end-game situation. If yes, we request an already requested piece
    // to try to speed up the end.
    if (interesting.cardinality() == 0) {
      interesting = peer.getAvailablePieces();
      interesting.andNot(this.completedPieces);
      if (interesting.cardinality() == 0) {
        logger.trace("No interesting piece from {}!", peer);
        return;
      }
View Full Code Here

Examples of java.util.BitSet.andNot()

  @Override
  public synchronized void handleBitfieldAvailability(SharingPeer peer,
      BitSet availablePieces) {
    // Determine if the peer is interesting for us or not, and notify it.
    BitSet interesting = (BitSet)availablePieces.clone();
    interesting.andNot(this.completedPieces);
    interesting.andNot(this.requestedPieces);

    if (interesting.cardinality() == 0) {
      peer.notInteresting();
    } else {
View Full Code Here

Examples of javaewah.EWAHCompressedBitmap.andNot()

    }

    // Remove the reused bitmaps from the paths
    if (!reuse.isEmpty())
      for (BitmapBuilder bitmap : paths)
        bitmap.andNot(reuseBitmap);

    // Sort the paths
    List<BitmapBuilder> distinctPaths = new ArrayList<BitmapBuilder>(paths.size());
    while (!paths.isEmpty()) {
      Collections.sort(paths, BUILDER_BY_CARDINALITY_DSC);
View Full Code Here

Examples of org.apache.lucene.util.FixedBitSet.andNot()

          res = new FixedBitSet(reader.maxDoc());
          res.set(0, reader.maxDoc()); // NOTE: may set bits on deleted docs
        }
        final DocIdSetIterator disi = getDISI(fc.getFilter(), context);
        if (disi != null) {
          res.andNot(disi);
        }
      }
    }
   
    for (final FilterClause fc : clauses) {
View Full Code Here

Examples of org.apache.lucene.util.OpenBitSet.andNot()

    return this.size() + other.size() - this.intersectionSize(other);
  }

  public DocSet andNot(DocSet other) {
    OpenBitSet newbits = (OpenBitSet)(this.getBits().clone());
    newbits.andNot(other.getBits());
    return new BitDocSet(newbits);
  }

  public int andNotSize(DocSet other) {
    return this.size() - this.intersectionSize(other);
View Full Code Here

Examples of org.apache.lucene.util.OpenBitSet.andNot()

  @Override
   public DocSet andNot(DocSet other) {
    OpenBitSet newbits = (OpenBitSet)(bits.clone());
     if (other instanceof BitDocSet) {
       newbits.andNot(((BitDocSet)other).bits);
     } else {
       DocIterator iter = other.iterator();
       while (iter.hasNext()) newbits.clear(iter.nextDoc());
     }
     return new BitDocSet(newbits);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.