本文整理了Java中java.util.BitSet.<init>()
方法的一些代码示例,展示了BitSet.<init>()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。BitSet.<init>()
方法的具体详情如下:
包路径:java.util.BitSet
类名称:BitSet
方法名:<init>
[英]Creates a new BitSet with size equal to 64 bits.
[中]创建大小等于64位的新位集。
代码示例来源:origin: netty/netty
public void setCleanerFlag(int index) {
if (cleanerFlags == null) {
cleanerFlags = new BitSet();
}
cleanerFlags.set(index);
}
}
代码示例来源:origin: jenkinsci/jenkins
public ArgumentListBuilder prepend(String... args) {
// left-shift the mask
BitSet nm = new BitSet(this.args.size()+args.length);
for(int i=0; i<this.args.size(); i++)
nm.set(i+args.length, mask.get(i));
mask = nm;
this.args.addAll(0, Arrays.asList(args));
return this;
}
代码示例来源:origin: commons-collections/commons-collections
/**
* Construct a ComparatorChain from the Comparators in the
* List. All Comparators will default to the forward
* sort order.
*
* @param list List of Comparators
* @see #ComparatorChain(List,BitSet)
*/
public ComparatorChain(List list) {
this(list,new BitSet(list.size()));
}
代码示例来源:origin: apache/zeppelin
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, getStatus_result struct) throws org.apache.thrift.TException {
TTupleProtocol oprot = (TTupleProtocol) prot;
BitSet optionals = new BitSet();
if (struct.isSetSuccess()) {
optionals.set(0);
}
oprot.writeBitSet(optionals, 1);
if (struct.isSetSuccess()) {
oprot.writeString(struct.success);
}
}
代码示例来源:origin: skylot/jadx
public static BitSet blocksToBitSet(MethodNode mth, List<BlockNode> blocks) {
BitSet bs = new BitSet(mth.getBasicBlocks().size());
for (BlockNode block : blocks) {
bs.set(block.getId());
}
return bs;
}
代码示例来源:origin: spring-projects/spring-framework
private void setMonths(BitSet bits, String value) {
int max = 12;
value = replaceOrdinals(value, "FOO,JAN,FEB,MAR,APR,MAY,JUN,JUL,AUG,SEP,OCT,NOV,DEC");
BitSet months = new BitSet(13);
// Months start with 1 in Cron and 0 in Calendar, so push the values first into a longer bit set
setNumberHits(months, value, 1, max + 1);
// ... and then rotate it to the front of the months
for (int i = 1; i <= max; i++) {
if (months.get(i)) {
bits.set(i - 1);
}
}
}
代码示例来源:origin: apache/zeppelin
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, appendOutput_args struct) throws org.apache.thrift.TException {
TTupleProtocol oprot = (TTupleProtocol) prot;
BitSet optionals = new BitSet();
if (struct.isSetEvent()) {
optionals.set(0);
}
oprot.writeBitSet(optionals, 1);
if (struct.isSetEvent()) {
struct.event.write(oprot);
}
}
代码示例来源:origin: apache/zeppelin
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, getProgress_result struct) throws org.apache.thrift.TException {
TTupleProtocol oprot = (TTupleProtocol) prot;
BitSet optionals = new BitSet();
if (struct.isSetSuccess()) {
optionals.set(0);
}
oprot.writeBitSet(optionals, 1);
if (struct.isSetSuccess()) {
oprot.writeI32(struct.success);
}
}
代码示例来源:origin: skylot/jadx
if (s.getIDom() != block) {
if (domFrontier == null) {
domFrontier = new BitSet(blocks.size());
domFrontier.set(s.getId());
if (blocks.get(p).getIDom() != block) {
if (domFrontier == null) {
domFrontier = new BitSet(blocks.size());
domFrontier.set(p);
代码示例来源:origin: looly/hutool
/**
* 构造,使用已有的比较器列表
*
* @param list 比较器列表
* @see #ComparatorChain(List,BitSet)
*/
public ComparatorChain(final List<Comparator<E>> list) {
this(list, new BitSet(list.size()));
}
代码示例来源:origin: skylot/jadx
private static void placePhi(MethodNode mth, int regNum, LiveVarAnalysis la) {
List<BlockNode> blocks = mth.getBasicBlocks();
int blocksCount = blocks.size();
BitSet hasPhi = new BitSet(blocksCount);
BitSet processed = new BitSet(blocksCount);
Deque<BlockNode> workList = new LinkedList<>();
BitSet assignBlocks = la.getAssignBlocks(regNum);
for (int id = assignBlocks.nextSetBit(0); id >= 0; id = assignBlocks.nextSetBit(id + 1)) {
processed.set(id);
workList.add(blocks.get(id));
}
while (!workList.isEmpty()) {
BlockNode block = workList.pop();
BitSet domFrontier = block.getDomFrontier();
for (int id = domFrontier.nextSetBit(0); id >= 0; id = domFrontier.nextSetBit(id + 1)) {
if (!hasPhi.get(id) && la.isLive(id, regNum)) {
BlockNode df = blocks.get(id);
addPhi(mth, df, regNum);
hasPhi.set(id);
if (!processed.get(id)) {
processed.set(id);
workList.add(df);
}
}
}
}
}
代码示例来源:origin: apache/kylin
@Override
public BitSet copy(final Kryo kryo, final BitSet original) {
final BitSet result = new BitSet();
final int length = original.length();
for (int i = 0; i < length; i++) {
result.set(i, original.get(i));
}
return result;
}
代码示例来源:origin: redisson/redisson
private static BitSet fromByteArrayReverse(byte[] bytes) {
BitSet bits = new BitSet();
for (int i = 0; i < bytes.length * 8; i++) {
if ((bytes[i / 8] & (1 << (7 - (i % 8)))) != 0) {
bits.set(i);
}
}
return bits;
}
代码示例来源:origin: apache/zeppelin
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, updateAllOutput_args struct) throws org.apache.thrift.TException {
TTupleProtocol oprot = (TTupleProtocol) prot;
BitSet optionals = new BitSet();
if (struct.isSetEvent()) {
optionals.set(0);
}
oprot.writeBitSet(optionals, 1);
if (struct.isSetEvent()) {
struct.event.write(oprot);
}
}
代码示例来源:origin: apache/zeppelin
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, angularRegistryPush_args struct) throws org.apache.thrift.TException {
TTupleProtocol oprot = (TTupleProtocol) prot;
BitSet optionals = new BitSet();
if (struct.isSetRegistry()) {
optionals.set(0);
}
oprot.writeBitSet(optionals, 1);
if (struct.isSetRegistry()) {
oprot.writeString(struct.registry);
}
}
代码示例来源:origin: apache/storm
@Override
public void write(org.apache.storm.thrift.protocol.TProtocol prot, TopologyHistoryInfo struct) throws org.apache.storm.thrift.TException {
org.apache.storm.thrift.protocol.TTupleProtocol oprot = (org.apache.storm.thrift.protocol.TTupleProtocol) prot;
java.util.BitSet optionals = new java.util.BitSet();
if (struct.is_set_topo_ids()) {
optionals.set(0);
}
oprot.writeBitSet(optionals, 1);
if (struct.is_set_topo_ids()) {
{
oprot.writeI32(struct.topo_ids.size());
for (java.lang.String _iter866 : struct.topo_ids)
{
oprot.writeString(_iter866);
}
}
}
}
代码示例来源:origin: looly/hutool
/**
* 构造,使用已有的比较器列表
*
* @param list 比较器列表
* @see #ComparatorChain(List,BitSet)
*/
public ComparatorChain(final List<Comparator<E>> list) {
this(list, new BitSet(list.size()));
}
代码示例来源:origin: skylot/jadx
private static void test(MethodNode mth, int regNum, LiveVarAnalysis la) {
List<BlockNode> blocks = mth.getBasicBlocks();
int blocksCount = blocks.size();
BitSet hasPhi = new BitSet(blocksCount);
BitSet processed = new BitSet(blocksCount);
Deque<BlockNode> workList = new LinkedList<>();
BitSet assignBlocks = la.getAssignBlocks(regNum);
for (int id = assignBlocks.nextSetBit(0); id >= 0; id = assignBlocks.nextSetBit(id + 1)) {
processed.set(id);
workList.add(blocks.get(id));
}
while (!workList.isEmpty()) {
BlockNode block = workList.pop();
BitSet domFrontier = block.getDomFrontier();
for (int id = domFrontier.nextSetBit(0); id >= 0; id = domFrontier.nextSetBit(id + 1)) {
if (!hasPhi.get(id) && la.isLive(id, regNum)) {
BlockNode df = blocks.get(id);
addPhi(df, regNum);
hasPhi.set(id);
if (!processed.get(id)) {
processed.set(id);
workList.add(df);
}
}
}
}
}
代码示例来源:origin: graphhopper/graphhopper
private BitSet getValidOn(BitSet validOnDay, int dayShift) {
if (dayShift == 0) {
return validOnDay;
} else {
BitSet bitSet = new BitSet(validOnDay.length() + 1);
for (int i=0; i<validOnDay.length(); i++) {
if (validOnDay.get(i)) {
bitSet.set(i+1);
}
}
return bitSet;
}
}
代码示例来源:origin: redisson/redisson
private static BitSet fromByteArrayReverse(byte[] bytes) {
BitSet bits = new BitSet();
for (int i = 0; i < bytes.length * 8; i++) {
if ((bytes[i / 8] & (1 << (7 - (i % 8)))) != 0) {
bits.set(i);
}
}
return bits;
}
内容来源于网络,如有侵权,请联系作者删除!