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

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

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

protected BitSet cloneBitSet()
{
 return (BitSet) bitmap.clone();
}

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

private SearchState(BitSet deletionMask, int currentIndex, SemanticGraph tree, String lastDeletedEdge, SearchState source, double score) {
  this.deletionMask = (BitSet) deletionMask.clone();
  this.currentIndex = currentIndex;
  this.tree = tree;
  this.lastDeletedEdge = lastDeletedEdge;
  this.source = source;
  this.score = score;
 }
}

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

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

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

/**
 * Creates a copy of actions.
 *
 * @param actions the actions to be copied from
 */
public AclActions(AclActions actions) {
 mActions = (BitSet) actions.mActions.clone();
}

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

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

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

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

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

@Override
public ArgumentListBuilder clone() {
  ArgumentListBuilder r = new ArgumentListBuilder();
  r.args.addAll(this.args);
  r.mask = (BitSet) this.mask.clone();
  return r;
}

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

/** get def OR born */
BitSet getCombo() {
  BitSet combo = (BitSet) born.clone();
  combo.or(def);
  return combo;
}

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

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

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

public ImmutableBitSet(BitSet set) {
  this.set = (BitSet) set.clone();
  this.arr = new int[set.cardinality()];
  int j = 0;
  for (int i = set.nextSetBit(0); i >= 0; i = set.nextSetBit(i + 1)) {
    arr[j++] = i;
  }
}

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

public boolean hasTopic(Topic topic) {
  BitSet m = new BloomFilter(topic).mask;
  BitSet m1 = (BitSet) m.clone();
  m1.and(mask);
  return m1.equals(m);
}

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

public ImmutableBooleanList newWith(boolean element)
{
  BitSet newItems = (BitSet) this.items.clone();
  if (element)
  {
    newItems.set(this.size);
  }
  return new ImmutableBooleanArrayList(newItems, this.size + 1);
}

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

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

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

@Override
public RVVExceptionB clone() {
 RVVExceptionB clone = new RVVExceptionB(previousVersion, nextVersion);
 if (this.received != null) {
  clone.received = (BitSet) this.received.clone();
  clone.receivedBaseVersion = this.receivedBaseVersion;
 }
 return clone;
}

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

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

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

@Override
public ImmutableBitmap intersection(ImmutableBitmap otherBitmap)
{
 WrappedBitSetBitmap retval = new WrappedBitSetBitmap((BitSet) bitmap.clone());
 retval.and((WrappedBitSetBitmap) otherBitmap);
 return retval;
}

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

public ImmutableBitmap union(ImmutableBitmap otherBitmap)
{
 WrappedBitSetBitmap retval = new WrappedBitSetBitmap((BitSet) bitmap.clone());
 retval.or((WrappedBitSetBitmap) otherBitmap);
 return retval;
}

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

public InputRequireThisValidateOnlyOverlappingFalse(BitSet fieldFinal3) {
  fieldFinal1 = 1L; // violation
  fieldFinal2 = 0L; // violation
  fieldFinal3 = new BitSet();
  if (true) {
    fieldFinal3 = (BitSet) fieldFinal3.clone();
  }
  this.fieldFinal3 = fieldFinal3;
}

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

public InputRequireThisValidateOnlyOverlappingTrue(BitSet fieldFinal3) {
  fieldFinal1 = 1L;
  fieldFinal2 = 0L;
  fieldFinal3 = new BitSet();
  if (true) {
    fieldFinal3 = (BitSet) fieldFinal3.clone();
  }
  this.fieldFinal3 = fieldFinal3;
}

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

public ImmutableBooleanList newWithAll(BooleanIterable elements)
{
  BitSet newItems = (BitSet) this.items.clone();
  int index = 0;
  for (BooleanIterator booleanIterator = elements.booleanIterator(); booleanIterator.hasNext(); index++)
  {
    if (booleanIterator.next())
    {
      newItems.set(this.size + index);
    }
  }
  return new ImmutableBooleanArrayList(newItems, this.size + elements.size());
}

相关文章