本文整理汇总了Java中java.util.BitSet.set方法的典型用法代码示例。如果您正苦于以下问题:Java BitSet.set方法的具体用法?Java BitSet.set怎么用?Java BitSet.set使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类java.util.BitSet
的用法示例。
在下文中一共展示了BitSet.set方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: write
import java.util.BitSet; //导入方法依赖的package包/类
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, Log_args struct)
throws TException
{
TTupleProtocol oprot = (TTupleProtocol) prot;
BitSet optionals = new BitSet();
if (struct.isSetMessages()) {
optionals.set(0);
}
oprot.writeBitSet(optionals, 1);
if (struct.isSetMessages()) {
{
oprot.writeI32(struct.messages.size());
for (LogEntry _iter4 : struct.messages) {
_iter4.write(oprot);
}
}
}
}
示例2: write
import java.util.BitSet; //导入方法依赖的package包/类
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, MetricTag struct) throws org.apache.thrift.TException {
TTupleProtocol oprot = (TTupleProtocol) prot;
BitSet optionals = new BitSet();
if (struct.isSetTagName()) {
optionals.set(0);
}
if (struct.isSetTagValue()) {
optionals.set(1);
}
oprot.writeBitSet(optionals, 2);
if (struct.isSetTagName()) {
oprot.writeString(struct.tagName);
}
if (struct.isSetTagValue()) {
oprot.writeString(struct.tagValue);
}
}
示例3: write
import java.util.BitSet; //导入方法依赖的package包/类
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, TResult struct) throws org.apache.thrift.TException {
TTupleProtocol oprot = (TTupleProtocol) prot;
{
oprot.writeI32(struct.columnValues.size());
for (TColumnValue _iter4 : struct.columnValues)
{
_iter4.write(oprot);
}
}
BitSet optionals = new BitSet();
if (struct.isSetRow()) {
optionals.set(0);
}
oprot.writeBitSet(optionals, 1);
if (struct.isSetRow()) {
oprot.writeBinary(struct.row);
}
}
示例4: write
import java.util.BitSet; //导入方法依赖的package包/类
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, SyncOfferMessage struct) throws org.apache.thrift.TException {
TTupleProtocol oprot = (TTupleProtocol) prot;
struct.header.write(oprot);
struct.store.write(oprot);
BitSet optionals = new BitSet();
if (struct.isSetVersions()) {
optionals.set(0);
}
oprot.writeBitSet(optionals, 1);
if (struct.isSetVersions()) {
{
oprot.writeI32(struct.versions.size());
for (KeyedVersions _iter44 : struct.versions)
{
_iter44.write(oprot);
}
}
}
}
示例5: write
import java.util.BitSet; //导入方法依赖的package包/类
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, isTableEnabled_result struct) throws org.apache.thrift.TException {
TTupleProtocol oprot = (TTupleProtocol) prot;
BitSet optionals = new BitSet();
if (struct.isSetSuccess()) {
optionals.set(0);
}
if (struct.isSetIo()) {
optionals.set(1);
}
oprot.writeBitSet(optionals, 2);
if (struct.isSetSuccess()) {
oprot.writeBool(struct.success);
}
if (struct.isSetIo()) {
struct.io.write(oprot);
}
}
示例6: testSeatBitMap
import java.util.BitSet; //导入方法依赖的package包/类
/**
* testSeatBitMap
*/
@Test
public void testSeatBitMap() throws Exception {
BitSet seats = client.getSeatsBitSet(flight_id);
assertNotNull(seats);
assertFalse(client.isFlightFull(seats));
for (int i = 0; i < SEATSConstants.FLIGHTS_NUM_SEATS; i++) {
assertFalse("SEAT #" + i, seats.get(i));
seats.set(i);
assertTrue("SEAT #" + i, seats.get(i));
if (i+1 < SEATSConstants.FLIGHTS_NUM_SEATS)
assertFalse(client.isFlightFull(seats));
} // FOR
assertTrue(client.isFlightFull(seats));
}
示例7: write
import java.util.BitSet; //导入方法依赖的package包/类
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, get_result struct) throws org.apache.thrift.TException {
TTupleProtocol oprot = (TTupleProtocol) prot;
BitSet optionals = new BitSet();
if (struct.isSetSuccess()) {
optionals.set(0);
}
if (struct.isSetIo()) {
optionals.set(1);
}
oprot.writeBitSet(optionals, 2);
if (struct.isSetSuccess()) {
struct.success.write(oprot);
}
if (struct.isSetIo()) {
struct.io.write(oprot);
}
}
示例8: write
import java.util.BitSet; //导入方法依赖的package包/类
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, sayHello_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);
}
}
示例9: testToString
import java.util.BitSet; //导入方法依赖的package包/类
@Test
public void testToString() {
BitSet activeCategories = new BitSet(10);
activeCategories.set(2);
activeCategories.set(5);
CategoricalDecision decision = new CategoricalDecision(0, activeCategories, true);
assertEquals("(#0 ∈ [2,5])", decision.toString());
}
示例10: write
import java.util.BitSet; //导入方法依赖的package包/类
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, getPackets_args struct) throws org.apache.thrift.TException {
TTupleProtocol oprot = (TTupleProtocol) prot;
BitSet optionals = new BitSet();
if (struct.isSetSessionid()) {
optionals.set(0);
}
oprot.writeBitSet(optionals, 1);
if (struct.isSetSessionid()) {
oprot.writeString(struct.sessionid);
}
}
示例11: computeTrue
import java.util.BitSet; //导入方法依赖的package包/类
/** Returns the (bit) set of all states. */
private BitSet computeTrue() {
BitSet result = new BitSet(this.nodeCount);
for (int i = 0; i < this.nodeCount; i++) {
result.set(i);
}
return result;
}
示例12: compatibleRegs
import java.util.BitSet; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override
public BitSet compatibleRegs(DalvInsn insn) {
RegisterSpecList regs = insn.getRegisters();
BitSet bits = new BitSet(1);
bits.set(0, unsignedFitsInByte(regs.get(0).getReg()));
return bits;
}
示例13: write
import java.util.BitSet; //导入方法依赖的package包/类
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, TIllegalArgument struct) throws org.apache.thrift.TException {
TTupleProtocol oprot = (TTupleProtocol) prot;
BitSet optionals = new BitSet();
if (struct.isSetMessage()) {
optionals.set(0);
}
oprot.writeBitSet(optionals, 1);
if (struct.isSetMessage()) {
oprot.writeString(struct.message);
}
}
示例14: regenerateCheckedBitSet
import java.util.BitSet; //导入方法依赖的package包/类
private void regenerateCheckedBitSet () {
checked = new BitSet (size);
for (int i = 0; i < size; i++) {
if (external[i] >= 0) {
checked.set (i);
}
}
}
示例15: getTopicMask
import java.util.BitSet; //导入方法依赖的package包/类
private BitSet getTopicMask(Topic topic) {
BitSet topicMask = new BitSet(BLOOM_BYTES * 8);
for (int i = 0; i < BITS_PER_BLOOM; i++) {
int x = topic.getBytes()[i] & 0xFF;
if ((topic.getBytes()[BITS_PER_BLOOM] & (1 << i)) != 0) {
x += 256;
}
topicMask.set(x);
}
return topicMask;
}