java.util.BitSet.andNot()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(5.1k)|赞(0)|评价(0)|浏览(123)

本文整理了Java中java.util.BitSet.andNot()方法的一些代码示例,展示了BitSet.andNot()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。BitSet.andNot()方法的具体详情如下:
包路径:java.util.BitSet
类名称:BitSet
方法名:andNot

BitSet.andNot介绍

[英]Clears all bits in this BitSet which are also set in bs.
[中]清除此位集中也在bs中设置的所有位。

代码示例

代码示例来源:origin: apache/zookeeper

/**
 * Remove the watches, and return the number of watches being removed.
 */
public synchronized int remove(Set<Integer> bitSet, BitSet bits) {
  cache.removeAll(bitSet);
  elementBits.andNot(bits);
  int elementCountBefore = elementCount;
  elementCount = elementBits.cardinality();
  return elementCountBefore - elementCount;
}

代码示例来源:origin: apache/geode

private static boolean subset(BitSet sub, BitSet sup) {
 BitSet subcopy = (BitSet) sub.clone();
 subcopy.andNot(sup);
 return subcopy.isEmpty();
}

代码示例来源:origin: apache/incubator-druid

public void andNot(MutableBitmap mutableBitmap)
{
 if (mutableBitmap instanceof WrappedBitSetBitmap) {
  WrappedBitSetBitmap bitSet = (WrappedBitSetBitmap) mutableBitmap;
  this.bitmap.andNot(bitSet.bitmap);
 } else {
  throw new IAE(
    "Unknown class type: %s  expected %s",
    mutableBitmap.getClass().getCanonicalName(),
    WrappedBitSetBitmap.class.getCanonicalName()
  );
 }
}

代码示例来源:origin: pentaho/pentaho-kettle

void intersect( BitSet set, boolean inverse ) {
 if ( inverse ) {
  candidates.andNot( set );
 } else {
  candidates.and( set );
 }
 checkEmpty();
}

代码示例来源:origin: org.apache.lucene/lucene-core

/** Returns true if there are dead states that reach an accept state. */
public static boolean hasDeadStatesToAccept(Automaton a) {
 BitSet reachableFromInitial = getLiveStatesFromInitial(a);
 BitSet reachableFromAccept = getLiveStatesToAccept(a);
 reachableFromAccept.andNot(reachableFromInitial);
 return reachableFromAccept.isEmpty() == false;
}

代码示例来源:origin: Sable/soot

@Override
public boolean isSubSet(FlowSet<T> other) {
 if (other == this) {
  return true;
 }
 if (sameType(other)) {
  ArrayPackedSet<T> o = (ArrayPackedSet<T>) other;
  BitSet tmp = (BitSet) o.bits.clone();
  tmp.andNot(bits);
  return tmp.isEmpty();
 }
 return super.isSubSet(other);
}

代码示例来源:origin: org.apache.lucene/lucene-core

/** Returns true if there are dead states reachable from an initial state. */
public static boolean hasDeadStatesFromInitial(Automaton a) {
 BitSet reachableFromInitial = getLiveStatesFromInitial(a);
 BitSet reachableFromAccept = getLiveStatesToAccept(a);
 reachableFromInitial.andNot(reachableFromAccept);
 return reachableFromInitial.isEmpty() == false;
}

代码示例来源:origin: Sable/soot

@Override
protected void merge(ArrayState in1, ArrayState in2, ArrayState out) {
 out.active.clear();
 out.active.or(in1.active);
 out.active.or(in2.active);
 BitSet in2_excl = (BitSet) in2.active.clone();
 in2_excl.andNot(in1.active);
 for (int i = in1.active.nextSetBit(0); i >= 0; i = in1.active.nextSetBit(i + 1)) {
  if (in1.state[i] == null) {
   out.state[i] = null;
  } else if (in2.active.get(i)) {
   if (in2.state[i] == null) {
    out.state[i] = null;
   } else {
    out.state[i] = mergeTypeStates(in1.state[i], in2.state[i]);
   }
  } else {
   out.state[i] = in1.state[i];
  }
 }
 for (int i = in2_excl.nextSetBit(0); i >= 0; i = in2_excl.nextSetBit(i + 1)) {
  out.state[i] = in2.state[i];
 }
}

代码示例来源:origin: apache/kylin

public ImmutableBitSet andNot(ImmutableBitSet another) {
  BitSet mutable = mutable();
  mutable.andNot(another.set);
  return new ImmutableBitSet(mutable);
}

代码示例来源:origin: skylot/jadx

newIn.or(liveIn[successors.get(s).getId()]);
newIn.andNot(defs[blockId]);
newIn.or(uses[blockId]);
if (!prevIn.equals(newIn)) {

代码示例来源:origin: apache/geode

/**
 * Return true if bs1 dominates bs2 - meaning that at least all of the bits set in bs2 are set in
 * bs1.
 *
 */
private boolean dominates(BitSet bs1, BitSet bs2) {
 // bs1 dominates bs2 if it has set at least all of the bits in bs1.
 BitSet copy = new BitSet();
 // Make copy a copy of bit set 2
 copy.or(bs2);
 // Clear all of the bits in copy that are set in bit set 1
 copy.andNot(bs1);
 // If all of the bits have been cleared in copy, that means
 // bit set 1 had at least all of the bits set that were set in
 // bs2
 return copy.isEmpty();
}

代码示例来源:origin: mpetazzoni/ttorrent

interesting.andNot(this.completedPieces);
interesting.andNot(this.requestedPieces);

代码示例来源:origin: skylot/jadx

for (int i = bs.nextSetBit(0); i >= 0; i = bs.nextSetBit(i + 1)) {
  BlockNode dom = basicBlocks.get(i);
  bs.andNot(dom.getDoms());

代码示例来源:origin: Sable/soot

@Override
public void difference(FlowSet<T> otherFlow, FlowSet<T> destFlow) {
 if (sameType(otherFlow) && sameType(destFlow)) {
  ArrayPackedSet<T> other = (ArrayPackedSet<T>) otherFlow;
  ArrayPackedSet<T> dest = (ArrayPackedSet<T>) destFlow;
  copyBitSet(dest).andNot(other.bits);
 } else {
  super.difference(otherFlow, destFlow);
 }
}

代码示例来源:origin: mpetazzoni/ttorrent

interesting.andNot(this.completedPieces);
interesting.andNot(this.requestedPieces);

代码示例来源:origin: skylot/jadx

outs.andNot(b.getDomFrontier());
if (b.contains(AFlag.LOOP_START)) {
  outs.clear(b.getId());

代码示例来源:origin: graphhopper/graphhopper

gtfsStorage.getStopSequences().put(boardEdge.getEdge(), stopTime.stop_sequence);
gtfsStorage.getTripDescriptors().put(boardEdge.getEdge(), tripDescriptor.toByteArray());
accumulatorValidity.andNot(lastTrip.tripWithStopTimes.validOnDay);

代码示例来源:origin: konsoletyper/teavm

lowHighSurrogates.andNot(cc.getLowHighSurrogates());
  bits.andNot(cc.getBits());

代码示例来源:origin: konsoletyper/teavm

lowHighSurrogates.andNot(clazz.getLowHighSurrogates());
  bits.andNot(clazz.getBits());

代码示例来源:origin: konsoletyper/teavm

lowHighSurrogates.andNot(clazz.getLowHighSurrogates());
  bits.andNot(clazz.getBits());

相关文章