本文整理汇总了Java中java.util.BitSet.get方法的典型用法代码示例。如果您正苦于以下问题:Java BitSet.get方法的具体用法?Java BitSet.get怎么用?Java BitSet.get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类java.util.BitSet
的用法示例。
在下文中一共展示了BitSet.get方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: check
import java.util.BitSet; //导入方法依赖的package包/类
private boolean check(IRegion root, BitSet set) {
if (((AbstractRegion)root).contains(AFlag.REMOVE_FOR_FLAT)) {
if (root.getChildren() != null) {
for (IRegion region : root.getChildren()) {
if (!check(region, set))
return false;
}
}
return true;
}
if (root instanceof Region) {
int index = ((Region)root).getInsn().getInstruction().getIndex();
if (set.get(index)) //set before
return false;
set.set(index);
}
return true;
}
示例2: read
import java.util.BitSet; //导入方法依赖的package包/类
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, Node struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
BitSet incoming = iprot.readBitSet(4);
if (incoming.get(0)) {
struct.nodeId = iprot.readI16();
struct.setNodeIdIsSet(true);
}
if (incoming.get(1)) {
struct.domainId = iprot.readI16();
struct.setDomainIdIsSet(true);
}
if (incoming.get(2)) {
struct.hostname = iprot.readString();
struct.setHostnameIsSet(true);
}
if (incoming.get(3)) {
struct.port = iprot.readI32();
struct.setPortIsSet(true);
}
}
示例3: read
import java.util.BitSet; //导入方法依赖的package包/类
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, getRowsWithColumns_result struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
BitSet incoming = iprot.readBitSet(2);
if (incoming.get(0)) {
{
org.apache.thrift.protocol.TList _list283 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
struct.success = new ArrayList<TRowResult>(_list283.size);
TRowResult _elem284;
for (int _i285 = 0; _i285 < _list283.size; ++_i285)
{
_elem284 = new TRowResult();
_elem284.read(iprot);
struct.success.add(_elem284);
}
}
struct.setSuccessIsSet(true);
}
if (incoming.get(1)) {
struct.io = new IOError();
struct.io.read(iprot);
struct.setIoIsSet(true);
}
}
示例4: main
import java.util.BitSet; //导入方法依赖的package包/类
public static void main(String[] args) {
String[] malformedIPv4s = {"192.168.1.220..."};
BitSet expectedExceptions = new BitSet(malformedIPv4s.length);
expectedExceptions.clear();
for (int i = 0; i < malformedIPv4s.length; i++) {
try {
InetAddress.getAllByName(malformedIPv4s[i]);
} catch (UnknownHostException e) {
expectedExceptions.set(i);
}
}
for (int i = 0; i < malformedIPv4s.length; i++) {
if (!expectedExceptions.get(i)) {
System.out.println("getAllByName(\"" + malformedIPv4s[i] + "\") should throw exception.");
}
}
if (expectedExceptions.cardinality() != malformedIPv4s.length) {
throw new RuntimeException("Failed: some expected UnknownHostExceptions are not thrown.");
}
}
示例5: read
import java.util.BitSet; //导入方法依赖的package包/类
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, getScannerRows_result struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
BitSet incoming = iprot.readBitSet(3);
if (incoming.get(0)) {
{
org.apache.thrift.protocol.TList _list177 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
struct.success = new ArrayList<TResult>(_list177.size);
TResult _elem178;
for (int _i179 = 0; _i179 < _list177.size; ++_i179)
{
_elem178 = new TResult();
_elem178.read(iprot);
struct.success.add(_elem178);
}
}
struct.setSuccessIsSet(true);
}
if (incoming.get(1)) {
struct.io = new TIOError();
struct.io.read(iprot);
struct.setIoIsSet(true);
}
if (incoming.get(2)) {
struct.ia = new TIllegalArgument();
struct.ia.read(iprot);
struct.setIaIsSet(true);
}
}
示例6: read
import java.util.BitSet; //导入方法依赖的package包/类
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, THRegionInfo struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
struct.regionId = iprot.readI64();
struct.setRegionIdIsSet(true);
struct.tableName = iprot.readBinary();
struct.setTableNameIsSet(true);
BitSet incoming = iprot.readBitSet(5);
if (incoming.get(0)) {
struct.startKey = iprot.readBinary();
struct.setStartKeyIsSet(true);
}
if (incoming.get(1)) {
struct.endKey = iprot.readBinary();
struct.setEndKeyIsSet(true);
}
if (incoming.get(2)) {
struct.offline = iprot.readBool();
struct.setOfflineIsSet(true);
}
if (incoming.get(3)) {
struct.split = iprot.readBool();
struct.setSplitIsSet(true);
}
if (incoming.get(4)) {
struct.replicaId = iprot.readI32();
struct.setReplicaIdIsSet(true);
}
}
示例7: enqueueSuccessors
import java.util.BitSet; //导入方法依赖的package包/类
/**
* Add successor blocks into the given work list if they are not already marked as visited.
*/
private static <T extends AbstractBlockBase<T>> void enqueueSuccessors(T block, PriorityQueue<T> worklist, BitSet visitedBlocks) {
for (T successor : block.getSuccessors()) {
if (!visitedBlocks.get(successor.getId())) {
visitedBlocks.set(successor.getId());
worklist.add(successor);
}
}
}
示例8: prevalidate
import java.util.BitSet; //导入方法依赖的package包/类
/**
* Pre-validate the unescaped URI string within a specific component.
*
* @param component the component string within the component
* @param disallowed those characters disallowed within the component
* @return if true, it doesn't have the disallowed characters
* if false, the component is undefined or an incorrect one
*/
protected boolean prevalidate(String component, BitSet disallowed) {
// prevalidate the given component by disallowed characters
if (component == null) {
return false; // undefined
}
char[] target = component.toCharArray();
for (int i = 0; i < target.length; i++) {
if (disallowed.get(target[i])) {
return false;
}
}
return true;
}
示例9: getMessageForConsistency
import java.util.BitSet; //导入方法依赖的package包/类
/**
* Utility in charge of creating the message when the class is not
* consistent within a specific context
*
* @param minBitset
* bitset describing which CIM attributes of this class have
* to be set so that it is consistent within a
* specific subset context
* @return the message explaining what is not consistent
*/
private String getMessageForConsistency(final BitSet minBitset) {
StringBuilder message = new StringBuilder(
"Instance of \"IEC61970CIMVersion\" of id \"");
message.append(this.getId());
message.append("\" is not consistent in this context:\n");
/*
* XOR and then AND
* The result is :
* "1" : has not been set and need to be
* "0" : has been set or is not mandatory
*/
BitSet isNotSet = new BitSet(minBitset.length());
isNotSet.or(minBitset);
// we create a copy of minBitset
isNotSet.xor(this.currentBitset);
isNotSet.and(minBitset);
if (isNotSet.get(0)) {
message.append("\t\"version\" needs to be set\n");
}
if (isNotSet.get(1)) {
message.append("\t\"date\" needs to be set\n");
}
return message.toString();
}
示例10: getCoverPoints
import java.util.BitSet; //导入方法依赖的package包/类
/**
* Returns all {@link VisibilityLocation} that are NOT visible according to 'column' (column[key] == FALSE, locations.get(key) included).
* @param column
* @return
*/
public Set<VisibilityLocation> getCoverPoints(BitSet column) {
Set<VisibilityLocation> result = new HashSet<VisibilityLocation>();
for (int i = 0; i < column.length() && i < matrix.rows(); ++i) {
if (!column.get(i)) {
result.add(locations.get(i));
}
}
return result;
}
示例11: read
import java.util.BitSet; //导入方法依赖的package包/类
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, test_result struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
BitSet incoming = iprot.readBitSet(1);
if (incoming.get(0)) {
struct.success = iprot.readString();
struct.setSuccessIsSet(true);
}
}
示例12: firstIndexOfChar
import java.util.BitSet; //导入方法依赖的package包/类
public static int firstIndexOfChar(String sqlString, BitSet keys, int startindex) {
for ( int i = startindex, size = sqlString.length(); i < size; i++ ) {
if ( keys.get( sqlString.charAt( i ) ) ) {
return i;
}
}
return -1;
}
示例13: read
import java.util.BitSet; //导入方法依赖的package包/类
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, echo_args struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
BitSet incoming = iprot.readBitSet(1);
if (incoming.get(0)) {
struct.msg = iprot.readString();
struct.setMsgIsSet(true);
}
}
示例14: markSubroutineWalk
import java.util.BitSet; //导入方法依赖的package包/类
/**
* Performs a depth first search walking the normal byte code path starting
* at <code>index</code>, and adding each instruction encountered into the
* subroutine <code>sub</code>. After this walk is complete, iterates over
* the exception handlers to ensure that we also include those byte codes
* which are reachable through an exception that may be thrown during the
* execution of the subroutine. Invoked from <code>markSubroutines()</code>.
*
* @param sub
* the subroutine whose instructions must be computed.
* @param index
* an instruction of this subroutine.
* @param anyvisited
* indexes of the already visited instructions, i.e. marked as
* part of this subroutine or any previously computed subroutine.
*/
private void markSubroutineWalk(final BitSet sub, final int index,
final BitSet anyvisited) {
if (LOGGING) {
log("markSubroutineWalk: sub=" + sub + " index=" + index);
}
// First find those instructions reachable via normal execution
markSubroutineWalkDFS(sub, index, anyvisited);
// Now, make sure we also include any applicable exception handlers
boolean loop = true;
while (loop) {
loop = false;
for (Iterator<TryCatchBlockNode> it = tryCatchBlocks.iterator(); it
.hasNext();) {
TryCatchBlockNode trycatch = it.next();
if (LOGGING) {
// TODO use of default toString().
log("Scanning try/catch " + trycatch);
}
// If the handler has already been processed, skip it.
int handlerindex = instructions.indexOf(trycatch.handler);
if (sub.get(handlerindex)) {
continue;
}
int startindex = instructions.indexOf(trycatch.start);
int endindex = instructions.indexOf(trycatch.end);
int nextbit = sub.nextSetBit(startindex);
if (nextbit != -1 && nextbit < endindex) {
if (LOGGING) {
log("Adding exception handler: " + startindex + '-'
+ endindex + " due to " + nextbit + " handler "
+ handlerindex);
}
markSubroutineWalkDFS(sub, handlerindex, anyvisited);
loop = true;
}
}
}
}
示例15: isTop
import java.util.BitSet; //导入方法依赖的package包/类
/**
* Return whether or not given fact is the special TOP value.
*/
public boolean isTop(BitSet fact) {
return fact.get(topBit);
}