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

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

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

BitSet.clone介绍

[英]Cloning this BitSet produces a new BitSetthat is equal to it. The clone of the bit set is another bit set that has exactly the same bits set to true as this bit set.
[中]克隆此位集将生成与之相等的新位集。该位集的克隆是另一个位集,该位集的位设置与该位集的位设置完全相同。

代码示例

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

  1. protected BitSet cloneBitSet()
  2. {
  3. return (BitSet) bitmap.clone();
  4. }

代码示例来源:origin: stanfordnlp/CoreNLP

  1. private SearchState(BitSet deletionMask, int currentIndex, SemanticGraph tree, String lastDeletedEdge, SearchState source, double score) {
  2. this.deletionMask = (BitSet) deletionMask.clone();
  3. this.currentIndex = currentIndex;
  4. this.tree = tree;
  5. this.lastDeletedEdge = lastDeletedEdge;
  6. this.source = source;
  7. this.score = score;
  8. }
  9. }

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

  1. private BitSetMatcher(BitSet table, String description) {
  2. super(description);
  3. if (table.length() + Long.SIZE < table.size()) {
  4. table = (BitSet) table.clone();
  5. // If only we could actually call BitSet.trimToSize() ourselves...
  6. }
  7. this.table = table;
  8. }

代码示例来源:origin: Alluxio/alluxio

  1. /**
  2. * Creates a copy of actions.
  3. *
  4. * @param actions the actions to be copied from
  5. */
  6. public AclActions(AclActions actions) {
  7. mActions = (BitSet) actions.mActions.clone();
  8. }

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

  1. private BitSetMatcher(BitSet table, String description) {
  2. super(description);
  3. if (table.length() + Long.SIZE < table.size()) {
  4. table = (BitSet) table.clone();
  5. // If only we could actually call BitSet.trimToSize() ourselves...
  6. }
  7. this.table = table;
  8. }

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

  1. private BitSetMatcher(BitSet table, String description) {
  2. super(description);
  3. if (table.length() + Long.SIZE < table.size()) {
  4. table = (BitSet) table.clone();
  5. // If only we could actually call BitSet.trimToSize() ourselves...
  6. }
  7. this.table = table;
  8. }

代码示例来源:origin: jenkinsci/jenkins

  1. @Override
  2. public ArgumentListBuilder clone() {
  3. ArgumentListBuilder r = new ArgumentListBuilder();
  4. r.args.addAll(this.args);
  5. r.mask = (BitSet) this.mask.clone();
  6. return r;
  7. }

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

  1. /** get def OR born */
  2. BitSet getCombo() {
  3. BitSet combo = (BitSet) born.clone();
  4. combo.or(def);
  5. return combo;
  6. }

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

  1. private BitSetMatcher(BitSet table, String description) {
  2. super(description);
  3. if (table.length() + Long.SIZE < table.size()) {
  4. table = (BitSet) table.clone();
  5. // If only we could actually call BitSet.trimToSize() ourselves...
  6. }
  7. this.table = table;
  8. }

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

  1. public ImmutableBitSet(BitSet set) {
  2. this.set = (BitSet) set.clone();
  3. this.arr = new int[set.cardinality()];
  4. int j = 0;
  5. for (int i = set.nextSetBit(0); i >= 0; i = set.nextSetBit(i + 1)) {
  6. arr[j++] = i;
  7. }
  8. }

代码示例来源:origin: ethereum/ethereumj

  1. public boolean hasTopic(Topic topic) {
  2. BitSet m = new BloomFilter(topic).mask;
  3. BitSet m1 = (BitSet) m.clone();
  4. m1.and(mask);
  5. return m1.equals(m);
  6. }

代码示例来源:origin: goldmansachs/gs-collections

  1. public ImmutableBooleanList newWith(boolean element)
  2. {
  3. BitSet newItems = (BitSet) this.items.clone();
  4. if (element)
  5. {
  6. newItems.set(this.size);
  7. }
  8. return new ImmutableBooleanArrayList(newItems, this.size + 1);
  9. }

代码示例来源: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/geode

  1. @Override
  2. public RVVExceptionB clone() {
  3. RVVExceptionB clone = new RVVExceptionB(previousVersion, nextVersion);
  4. if (this.received != null) {
  5. clone.received = (BitSet) this.received.clone();
  6. clone.receivedBaseVersion = this.receivedBaseVersion;
  7. }
  8. return clone;
  9. }

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

  1. public void deepCloneLocalValueSlot(int localRef, int index) {
  2. this.state[localRef] = (ArrayTypesInternal) this.state[localRef].clone();
  3. this.state[localRef].typeState[index] = (BitSet) this.state[localRef].typeState[index].clone();
  4. }
  5. }

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

  1. @Override
  2. public ImmutableBitmap intersection(ImmutableBitmap otherBitmap)
  3. {
  4. WrappedBitSetBitmap retval = new WrappedBitSetBitmap((BitSet) bitmap.clone());
  5. retval.and((WrappedBitSetBitmap) otherBitmap);
  6. return retval;
  7. }

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

  1. public ImmutableBitmap union(ImmutableBitmap otherBitmap)
  2. {
  3. WrappedBitSetBitmap retval = new WrappedBitSetBitmap((BitSet) bitmap.clone());
  4. retval.or((WrappedBitSetBitmap) otherBitmap);
  5. return retval;
  6. }

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

  1. public InputRequireThisValidateOnlyOverlappingFalse(BitSet fieldFinal3) {
  2. fieldFinal1 = 1L; // violation
  3. fieldFinal2 = 0L; // violation
  4. fieldFinal3 = new BitSet();
  5. if (true) {
  6. fieldFinal3 = (BitSet) fieldFinal3.clone();
  7. }
  8. this.fieldFinal3 = fieldFinal3;
  9. }

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

  1. public InputRequireThisValidateOnlyOverlappingTrue(BitSet fieldFinal3) {
  2. fieldFinal1 = 1L;
  3. fieldFinal2 = 0L;
  4. fieldFinal3 = new BitSet();
  5. if (true) {
  6. fieldFinal3 = (BitSet) fieldFinal3.clone();
  7. }
  8. this.fieldFinal3 = fieldFinal3;
  9. }

代码示例来源:origin: goldmansachs/gs-collections

  1. public ImmutableBooleanList newWithAll(BooleanIterable elements)
  2. {
  3. BitSet newItems = (BitSet) this.items.clone();
  4. int index = 0;
  5. for (BooleanIterator booleanIterator = elements.booleanIterator(); booleanIterator.hasNext(); index++)
  6. {
  7. if (booleanIterator.next())
  8. {
  9. newItems.set(this.size + index);
  10. }
  11. }
  12. return new ImmutableBooleanArrayList(newItems, this.size + elements.size());
  13. }

相关文章