Package java.util

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


   */
  @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

    // 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

  @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

  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 {
      peer.interesting();
View Full Code Here

     @return (liveout - def) + UE
     */
    BitSet getLivein()
    {
       BitSet result = (BitSet)this.liveout.clone();
       result.andNot(this.def);
       result.or(this.ue_vars);
       return result;
    }
   
    /**
 
View Full Code Here

      {
        //  Note parameters as active.
        for ( int i = 0; i < m.getParams().length; i++)
          result.set(i);
      }
      result.andNot(this.killed_vars);
      return result;
    }
   
    BitSet getLiveout()
    {
View Full Code Here

                Vertex v = (Vertex) vertices.next();

                BitSet out = new BitSet();
                out.or( (BitSet) inValues.get( v ) );
                out.or( eq.generates( v ) );
                out.andNot( eq.kills( v ) );

                /*
            System.err.println("Old Out: " + v + ":" + outValues.get( v ));
            System.err.println("New Out: " + v + ":" + out);
            */
 
View Full Code Here

      if (b0 != null && b0.length() <= b.length()) {
        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_andn = (BitSet)a.clone(); a_andn.andNot(a0);

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

        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 = b.clone(); assertEquals(b,b_and); b_and.and(b0);
        OpenBitSet b_or = b.clone(); b_or.or(b0);
        OpenBitSet b_xor = b.clone(); b_xor.xor(b0);
        OpenBitSet b_andn = b.clone(); b_andn.andNot(b0);
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.