本文整理了Java中java.util.BitSet.or()
方法的一些代码示例,展示了BitSet.or()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。BitSet.or()
方法的具体详情如下:
包路径:java.util.BitSet
类名称:BitSet
方法名:or
[英]Logically ors the bits of this BitSet with bs.
[中]逻辑上,将此位集的位与B进行OR运算。
代码示例来源:origin: Sable/soot
protected void merge(BitSet in1, BitSet in2, BitSet out) {
out.clear();
out.or(in1);
out.or(in2);
}
代码示例来源:origin: google/guava
@GwtIncompatible // used only from other GwtIncompatible code
@Override
void setBits(BitSet table) {
BitSet tmp1 = new BitSet();
first.setBits(tmp1);
BitSet tmp2 = new BitSet();
second.setBits(tmp2);
tmp1.and(tmp2);
table.or(tmp1);
}
代码示例来源:origin: skylot/jadx
public static BlockNode getPathCross(MethodNode mth, BlockNode b1, BlockNode b2) {
if (b1 == null || b2 == null) {
return null;
}
BitSet b = new BitSet();
b.or(b1.getDomFrontier());
b.and(b2.getDomFrontier());
b.clear(b1.getId());
b.clear(b2.getId());
if (b.cardinality() == 1) {
BlockNode end = mth.getBasicBlocks().get(b.nextSetBit(0));
if (isPathExists(b1, end) && isPathExists(b2, end)) {
return end;
}
}
if (isPathExists(b1, b2)) {
return b2;
}
if (isPathExists(b2, b1)) {
return b1;
}
return null;
}
代码示例来源:origin: mpetazzoni/ttorrent
public PieceStorageImpl(TorrentByteStorage fileCollectionStorage,
BitSet availablePieces,
int piecesCount,
int pieceSize) {
this.fileCollectionStorage = fileCollectionStorage;
this.readWriteLock = new ReentrantReadWriteLock();
this.piecesCount = piecesCount;
this.pieceSize = pieceSize;
BitSet bitSet = new BitSet(piecesCount);
bitSet.or(availablePieces);
if (bitSet.cardinality() != piecesCount) {
this.availablePieces = bitSet;
}
isOpen = false;
}
代码示例来源:origin: pxb1988/dex2jar
BitSet excludeColor = new BitSet();
BitSet suggestColor = new BitSet();
BitSet globalExcludes = new BitSet();
BitSet usedInOneType = new BitSet();
for (Map.Entry<Character, List<Reg>> e : groups.entrySet()) {
excludeParameters(excludeColor, args, type);
excludeColor.or(globalExcludes); // exclude index used by other types
globalExcludes.or(usedInOneType);
usedInOneType.clear();
代码示例来源:origin: twitter/distributedlog
/**
* Performs a deep copy on <i>other</i>.
*/
public AccessControlEntry(AccessControlEntry other) {
__isset_bit_vector.clear();
__isset_bit_vector.or(other.__isset_bit_vector);
this.denyWrite = other.denyWrite;
this.denyTruncate = other.denyTruncate;
this.denyDelete = other.denyDelete;
this.denyAcquire = other.denyAcquire;
this.denyRelease = other.denyRelease;
}
代码示例来源:origin: google/guava
@GwtIncompatible // used only from other GwtIncompatible code
@Override
void setBits(BitSet table) {
BitSet tmp = new BitSet();
original.setBits(tmp);
tmp.flip(Character.MIN_VALUE, Character.MAX_VALUE + 1);
table.or(tmp);
}
代码示例来源:origin: skylot/jadx
BlockNode block = basicBlocks.get(i);
block.setId(i);
block.setDoms(new BitSet(nBlocks));
block.getDoms().set(0, nBlocks);
entryBlock.getDoms().clear();
entryBlock.getDoms().set(entryBlock.getId());
BitSet dset = new BitSet(nBlocks);
boolean changed;
do {
dset.clear();
dset.or(d);
basicBlocks.forEach(block -> block.getDoms().clear(block.getId()));
idom = preds.get(0);
} else {
BitSet bs = new BitSet(block.getDoms().length());
bs.or(block.getDoms());
for (int i = bs.nextSetBit(0); i >= 0; i = bs.nextSetBit(i + 1)) {
BlockNode dom = basicBlocks.get(i);
代码示例来源:origin: twitter/distributedlog
/**
* Performs a deep copy on <i>other</i>.
*/
public HeartbeatOptions(HeartbeatOptions other) {
__isset_bit_vector.clear();
__isset_bit_vector.or(other.__isset_bit_vector);
this.sendHeartBeatToReader = other.sendHeartBeatToReader;
}
代码示例来源:origin: atlassian/commonmark-java
public static BitSet calculateSpecialCharacters(BitSet delimiterCharacters) {
BitSet bitSet = new BitSet();
bitSet.or(delimiterCharacters);
bitSet.set('\n');
bitSet.set('`');
bitSet.set('[');
bitSet.set(']');
bitSet.set('\\');
bitSet.set('!');
bitSet.set('<');
bitSet.set('&');
return bitSet;
}
代码示例来源:origin: apache/kylin
final BitSet parent2Key = second.getRepresentation();
final BitSet child1Key = new BitSet(length);
final BitSet child2Key = new BitSet(length);
a.clear(crossoverIndex, length);
BitSet b = (BitSet) parent2Key.clone();
b.clear(0, crossoverIndex);
c.clear(crossoverIndex, length);
BitSet d = (BitSet) parent2Key.clone();
d.clear(0, crossoverIndex);
child1Key.or(a);
child1Key.or(d);
child2Key.or(c);
child2Key.or(b);
return new ChromosomePair(first.newBitsChromosome(child1Key), second.newBitsChromosome(child2Key));
代码示例来源:origin: twitter/distributedlog
/**
* Performs a deep copy on <i>other</i>.
*/
public setAcceptNewStream_args(setAcceptNewStream_args other) {
__isset_bit_vector.clear();
__isset_bit_vector.or(other.__isset_bit_vector);
this.enabled = other.enabled;
}
代码示例来源:origin: prestodb/presto
@GwtIncompatible // used only from other GwtIncompatible code
@Override
void setBits(BitSet table) {
BitSet tmp1 = new BitSet();
first.setBits(tmp1);
BitSet tmp2 = new BitSet();
second.setBits(tmp2);
tmp1.and(tmp2);
table.or(tmp1);
}
代码示例来源:origin: skylot/jadx
BitSet outs = new BitSet(basicBlocks.size());
outs.or(block.getDomFrontier());
for (BlockNode s : block.getCleanSuccessors()) {
BitSet df = s.getDomFrontier();
if (second.getDomFrontier().get(first.getId())) {
fallThroughCases.put(s, second);
df = new BitSet(df.size());
df.set(first.getId());
} else if (first.getDomFrontier().get(second.getId())) {
fallThroughCases.put(s, first);
df = new BitSet(df.size());
df.set(second.getId());
outs.or(df);
outs.clear(block.getId());
if (loop != null) {
outs.clear(loop.getStart().getId());
outs.andNot(b.getDomFrontier());
if (b.contains(AFlag.LOOP_START)) {
outs.clear(b.getId());
} else {
for (BlockNode s : b.getCleanSuccessors()) {
代码示例来源:origin: alibaba/mdrill
/**
* Performs a deep copy on <i>other</i>.
*/
public KillOptions(KillOptions other) {
__isset_bit_vector.clear();
__isset_bit_vector.or(other.__isset_bit_vector);
this.wait_secs = other.wait_secs;
}
代码示例来源:origin: mpetazzoni/ttorrent
@Override
public BitSet getAvailablePieces() {
try {
readWriteLock.readLock().lock();
BitSet result = new BitSet(piecesCount);
BitSet availablePieces = this.availablePieces;
boolean isFullyDownloaded = availablePieces == null;
if (isFullyDownloaded) {
result.set(0, piecesCount);
return result;
}
result.or(availablePieces);
return result;
} finally {
readWriteLock.readLock().unlock();
}
}
代码示例来源:origin: spotbugs/spotbugs
private void removeStrictlyPostDominatedLocations(Set<Location> locations, PostDominatorsAnalysis postDomAnalysis) {
BitSet strictlyDominated = new BitSet();
for (Location loc : locations) {
BitSet allDominatedBy = postDomAnalysis.getAllDominatedBy(loc.getBasicBlock());
allDominatedBy.clear(loc.getBasicBlock().getLabel());
strictlyDominated.or(allDominatedBy);
}
LinkedList<Location> locations2 = new LinkedList<>(locations);
for (Iterator<Location> i = locations.iterator(); i.hasNext();) {
Location loc = i.next();
if (strictlyDominated.get(loc.getBasicBlock().getLabel())) {
i.remove();
continue;
}
for (Location loc2 : locations2) {
if (loc.getBasicBlock().equals(loc2.getBasicBlock())
&& loc.getHandle().getPosition() > loc2.getHandle().getPosition()) {
i.remove();
break;
}
}
}
}
代码示例来源:origin: alibaba/mdrill
/**
* Performs a deep copy on <i>other</i>.
*/
public RebalanceOptions(RebalanceOptions other) {
__isset_bit_vector.clear();
__isset_bit_vector.or(other.__isset_bit_vector);
this.wait_secs = other.wait_secs;
}
代码示例来源:origin: wildfly/wildfly
private static BitSet validCookieNameOctets(BitSet validCookieValueOctets) {
BitSet bits = new BitSet(8);
bits.or(validCookieValueOctets);
bits.set('(', false);
bits.set(')', false);
bits.set('<', false);
bits.set('>', false);
bits.set('@', false);
bits.set(':', false);
bits.set('/', false);
bits.set('[', false);
bits.set(']', false);
bits.set('?', false);
bits.set('=', false);
bits.set('{', false);
bits.set('}', false);
bits.set(' ', false);
bits.set('\t', false);
return bits;
}
代码示例来源:origin: spotbugs/spotbugs
private void removeStrictlyDominatedLocations(Set<Location> locations, DominatorsAnalysis domAnalysis) {
BitSet strictlyDominated = new BitSet();
for (Location loc : locations) {
BitSet allDominatedBy = domAnalysis.getAllDominatedBy(loc.getBasicBlock());
allDominatedBy.clear(loc.getBasicBlock().getLabel());
strictlyDominated.or(allDominatedBy);
}
LinkedList<Location> locations2 = new LinkedList<>(locations);
for (Iterator<Location> i = locations.iterator(); i.hasNext();) {
Location loc = i.next();
if (strictlyDominated.get(loc.getBasicBlock().getLabel())) {
i.remove();
continue;
}
for (Location loc2 : locations2) {
if (loc.getBasicBlock().equals(loc2.getBasicBlock())
&& loc.getHandle().getPosition() > loc2.getHandle().getPosition()) {
i.remove();
break;
}
}
}
}
内容来源于网络,如有侵权,请联系作者删除!