Examples of xor()


Examples of java.util.BitSet.xor()

  public String decode(final String str) {
    try {
      // create a BitSet based on the binary representation
      final BitSet nameSet = createBitSet(str);
       // xor the BitSet with the key
      nameSet.xor(key);

      // turn the xor'd BitSet back into a String
      final StringBuilder strBuff = new StringBuilder(str.length() * 7);
      for (int i = 0; i < nameSet.size(); i++) {
        if (nameSet.get(i)) {
View Full Code Here

Examples of java.util.BitSet.xor()

      binaryString = stringSizeBinary.concat(binaryString);
    }
    // create a BitSet based on the binary representation
    final BitSet nameSet = createBitSet(binaryString);
    // xor the BitSet with the key
    nameSet.xor(key);

    // turn the xor'd BitSet back into a String so it can be written to file
    final StringBuilder strBuff = new StringBuilder(str.length() * 7);
    for (int i = 0; i < nameSet.size(); i++) {
      if (nameSet.get(i)) {
View Full Code Here

Examples of java.util.BitSet.xor()

        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);
View Full Code Here

Examples of java.util.BitSet.xor()

        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);
View Full Code Here

Examples of java.util.BitSet.xor()

  }

  public void andNot(RoleMap other) {
    //return roles.clone().andNot(other.getRoles()); // only in 1.2
    BitSet oroles = (BitSet)other.getRoles().clone();
    oroles.xor(emptySet);
    roles.and(oroles);
  }

  public ObjectDict toDict() {
    ObjectIterator I = map.getKeys();
View Full Code Here

Examples of java.util.BitSet.xor()

        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);
View Full Code Here

Examples of java.util.BitSet.xor()

            if ( ly > lx ) { return -1; }

            BitSet x;
            x = new BitSet( ly );
            x.or( yset );
            x.xor( bitMask );

            if ( x.isEmpty() ) { return 0; }

            int ix = x.length() - 1;
            if ( bitMask.get( ix ) ) {
View Full Code Here

Examples of java.util.BitSet.xor()

      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_xor = (BitSet)a.clone(); a_xor.xor(a0);
        BitSet a_andn = (BitSet)a.clone(); a_andn.andNot(a0);

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

Examples of java.util.BitSet.xor()

      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_xor = (BitSet)a.clone(); a_xor.xor(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_xor = b.clone(); b_xor.xor(b0);
View Full Code Here

Examples of java.util.BitSet.xor()

            if ( ly > lx ) { return -1; }

            BitSet x;
            x = new BitSet( ly );
            x.or( yset );
            x.xor( bitMask );

            if ( x.isEmpty() ) { return 0; }

            int ix = x.length() - 1;
            if ( bitMask.get( ix ) ) {
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.