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

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

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

BitSet.flip介绍

[英]Flips the bit at index index.
[中]在索引处翻转位。

代码示例

代码示例来源:origin: org.apache.hadoop/hadoop-common

  1. @Override
  2. public void not() {
  3. bits.flip(0, vectorSize);
  4. }

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

  1. private static BitSet getAllIncompatible(int regCount) {
  2. BitSet incompatRegs = new BitSet(regCount);
  3. incompatRegs.flip(0, regCount);
  4. return incompatRegs;
  5. }

代码示例来源:origin: google/guava

  1. @GwtIncompatible // used only from other GwtIncompatible code
  2. @Override
  3. void setBits(BitSet table) {
  4. BitSet tmp = new BitSet();
  5. original.setBits(tmp);
  6. tmp.flip(Character.MIN_VALUE, Character.MAX_VALUE + 1);
  7. table.or(tmp);
  8. }

代码示例来源:origin: org.codehaus.groovy/groovy

  1. /**
  2. * Bitwise NEGATE a BitSet.
  3. *
  4. * @param self a BitSet
  5. * @return the bitwise NEGATE of the BitSet
  6. * @since 1.5.0
  7. */
  8. public static BitSet bitwiseNegate(BitSet self) {
  9. BitSet result = (BitSet) self.clone();
  10. result.flip(0, result.size() - 1);
  11. return result;
  12. }

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

  1. private ImmutableBitSet convert(long value, int length) {
  2. BitSet bits = new BitSet();
  3. for (int index = length - 1; index >= 0; index--) {
  4. if (value % 2 != 0) {
  5. bits.set(index);
  6. }
  7. value = value >>> 1;
  8. }
  9. // We flip the bits because Calcite considers that '1'
  10. // means that the column participates in the GroupBy
  11. // and '0' does not, as opposed to grouping_id.
  12. bits.flip(0, length);
  13. return ImmutableBitSet.FROM_BIT_SET.apply(bits);
  14. }

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

  1. /**
  2. * Called to coalesce a successor's usage into the current BB. Important: This should be called
  3. * before live variable analysis begins, because we don't bother merging this.in or this.born.
  4. */
  5. void absorb(Usage succ) {
  6. BitSet b = (BitSet) this.def.clone();
  7. b.flip(0, nLocals);
  8. b.and(succ.use);
  9. this.use.or(b);
  10. this.def.or(succ.def);
  11. }

代码示例来源:origin: prestodb/presto

  1. @GwtIncompatible // used only from other GwtIncompatible code
  2. @Override
  3. void setBits(BitSet table) {
  4. BitSet tmp = new BitSet();
  5. original.setBits(tmp);
  6. tmp.flip(Character.MIN_VALUE, Character.MAX_VALUE + 1);
  7. table.or(tmp);
  8. }

代码示例来源:origin: google/j2objc

  1. @GwtIncompatible // used only from other GwtIncompatible code
  2. @Override
  3. void setBits(BitSet table) {
  4. BitSet tmp = new BitSet();
  5. original.setBits(tmp);
  6. tmp.flip(Character.MIN_VALUE, Character.MAX_VALUE + 1);
  7. table.or(tmp);
  8. }

代码示例来源:origin: oracle/helidon

  1. @Override
  2. void setBits(BitSet table) {
  3. BitSet tmp = new BitSet();
  4. original.setBits(tmp);
  5. tmp.flip(Character.MIN_VALUE, Character.MAX_VALUE + 1);
  6. table.or(tmp);
  7. }

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

  1. private ImmutableBitSet convert(int value, int length) {
  2. BitSet bits = new BitSet();
  3. for (int index = length - 1; index >= 0; index--) {
  4. if (value % 2 != 0) {
  5. bits.set(index);
  6. }
  7. value = value >>> 1;
  8. }
  9. // We flip the bits because Calcite considers that '1'
  10. // means that the column participates in the GroupBy
  11. // and '0' does not, as opposed to grouping_id.
  12. bits.flip(0, length);
  13. return ImmutableBitSet.FROM_BIT_SET.apply(bits);
  14. }

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

  1. @GwtIncompatible // used only from other GwtIncompatible code
  2. @Override
  3. void setBits(BitSet table) {
  4. BitSet tmp = new BitSet();
  5. original.setBits(tmp);
  6. tmp.flip(Character.MIN_VALUE, Character.MAX_VALUE + 1);
  7. table.or(tmp);
  8. }

代码示例来源:origin: google/guava

  1. } else {
  2. table.flip(Character.MIN_VALUE, Character.MAX_VALUE + 1);
  3. int negatedCharacters = DISTINCT_CHARS - totalCharacters;
  4. String suffix = ".negate()";

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

  1. for (Handler handle : handUsage)
  2. def1.and(handle.catchBB.usage.def);
  3. def1.flip(0, nLocals);
  4. out.and(def1);
  5. for (Handler handler : handUsage)

代码示例来源:origin: prestodb/presto

  1. } else {
  2. table.flip(Character.MIN_VALUE, Character.MAX_VALUE + 1);
  3. int negatedCharacters = DISTINCT_CHARS - totalCharacters;
  4. String suffix = ".negate()";

代码示例来源:origin: google/j2objc

  1. } else {
  2. table.flip(Character.MIN_VALUE, Character.MAX_VALUE + 1);
  3. int negatedCharacters = DISTINCT_CHARS - totalCharacters;
  4. String suffix = ".negate()";

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

  1. fullSet.flip(0, graph.size());// set all to true

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

  1. } else {
  2. table.flip(Character.MIN_VALUE, Character.MAX_VALUE + 1);
  3. int negatedCharacters = DISTINCT_CHARS - totalCharacters;
  4. String suffix = ".negate()";

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

  1. @Override
  2. public void complement(FlowSet<T> destFlow) {
  3. if (sameType(destFlow)) {
  4. ArrayPackedSet<T> dest = (ArrayPackedSet<T>) destFlow;
  5. copyBitSet(dest).flip(0, dest.map.size());
  6. } else {
  7. super.complement(destFlow);
  8. }
  9. }

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

  1. @Override
  2. public void not() {
  3. bits.flip(0, vectorSize - 1);
  4. }

代码示例来源:origin: klout/brickhouse

  1. @Override
  2. public void not() {
  3. bits.flip(0, vectorSize - 1);
  4. }

相关文章