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

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

本文整理了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

  1. /**
  2. * Remove the watches, and return the number of watches being removed.
  3. */
  4. public synchronized int remove(Set<Integer> bitSet, BitSet bits) {
  5. cache.removeAll(bitSet);
  6. elementBits.andNot(bits);
  7. int elementCountBefore = elementCount;
  8. elementCount = elementBits.cardinality();
  9. return elementCountBefore - elementCount;
  10. }

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

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

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

  1. public void andNot(MutableBitmap mutableBitmap)
  2. {
  3. if (mutableBitmap instanceof WrappedBitSetBitmap) {
  4. WrappedBitSetBitmap bitSet = (WrappedBitSetBitmap) mutableBitmap;
  5. this.bitmap.andNot(bitSet.bitmap);
  6. } else {
  7. throw new IAE(
  8. "Unknown class type: %s expected %s",
  9. mutableBitmap.getClass().getCanonicalName(),
  10. WrappedBitSetBitmap.class.getCanonicalName()
  11. );
  12. }
  13. }

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

  1. void intersect( BitSet set, boolean inverse ) {
  2. if ( inverse ) {
  3. candidates.andNot( set );
  4. } else {
  5. candidates.and( set );
  6. }
  7. checkEmpty();
  8. }

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

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

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

  1. @Override
  2. public boolean isSubSet(FlowSet<T> other) {
  3. if (other == this) {
  4. return true;
  5. }
  6. if (sameType(other)) {
  7. ArrayPackedSet<T> o = (ArrayPackedSet<T>) other;
  8. BitSet tmp = (BitSet) o.bits.clone();
  9. tmp.andNot(bits);
  10. return tmp.isEmpty();
  11. }
  12. return super.isSubSet(other);
  13. }

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

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

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

  1. @Override
  2. protected void merge(ArrayState in1, ArrayState in2, ArrayState out) {
  3. out.active.clear();
  4. out.active.or(in1.active);
  5. out.active.or(in2.active);
  6. BitSet in2_excl = (BitSet) in2.active.clone();
  7. in2_excl.andNot(in1.active);
  8. for (int i = in1.active.nextSetBit(0); i >= 0; i = in1.active.nextSetBit(i + 1)) {
  9. if (in1.state[i] == null) {
  10. out.state[i] = null;
  11. } else if (in2.active.get(i)) {
  12. if (in2.state[i] == null) {
  13. out.state[i] = null;
  14. } else {
  15. out.state[i] = mergeTypeStates(in1.state[i], in2.state[i]);
  16. }
  17. } else {
  18. out.state[i] = in1.state[i];
  19. }
  20. }
  21. for (int i = in2_excl.nextSetBit(0); i >= 0; i = in2_excl.nextSetBit(i + 1)) {
  22. out.state[i] = in2.state[i];
  23. }
  24. }

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

  1. public ImmutableBitSet andNot(ImmutableBitSet another) {
  2. BitSet mutable = mutable();
  3. mutable.andNot(another.set);
  4. return new ImmutableBitSet(mutable);
  5. }

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

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

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

  1. /**
  2. * Return true if bs1 dominates bs2 - meaning that at least all of the bits set in bs2 are set in
  3. * bs1.
  4. *
  5. */
  6. private boolean dominates(BitSet bs1, BitSet bs2) {
  7. // bs1 dominates bs2 if it has set at least all of the bits in bs1.
  8. BitSet copy = new BitSet();
  9. // Make copy a copy of bit set 2
  10. copy.or(bs2);
  11. // Clear all of the bits in copy that are set in bit set 1
  12. copy.andNot(bs1);
  13. // If all of the bits have been cleared in copy, that means
  14. // bit set 1 had at least all of the bits set that were set in
  15. // bs2
  16. return copy.isEmpty();
  17. }

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

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

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

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

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

  1. @Override
  2. public void difference(FlowSet<T> otherFlow, FlowSet<T> destFlow) {
  3. if (sameType(otherFlow) && sameType(destFlow)) {
  4. ArrayPackedSet<T> other = (ArrayPackedSet<T>) otherFlow;
  5. ArrayPackedSet<T> dest = (ArrayPackedSet<T>) destFlow;
  6. copyBitSet(dest).andNot(other.bits);
  7. } else {
  8. super.difference(otherFlow, destFlow);
  9. }
  10. }

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

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

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

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

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

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

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

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

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

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

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

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

相关文章