本文整理汇总了Java中gov.nasa.jpf.util.FinalBitSet类的典型用法代码示例。如果您正苦于以下问题:Java FinalBitSet类的具体用法?Java FinalBitSet怎么用?Java FinalBitSet使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
FinalBitSet类属于gov.nasa.jpf.util包,在下文中一共展示了FinalBitSet类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getInstanceFilterMask
import gov.nasa.jpf.util.FinalBitSet; //导入依赖的package包/类
protected FinalBitSet getInstanceFilterMask(ClassInfo ci) {
FinalBitSet v = instanceFilterMasks.get(ci);
if (v == null) {
BitArray b = new BitArray(ci.getInstanceDataSize());
b.setAll();
for (FieldInfo fi : filter.getMatchedInstanceFields(ci)) {
int start = fi.getStorageOffset();
int end = start + fi.getStorageSize();
for (int i = start; i < end; i++) {
b.clear(i);
}
}
v = FinalBitSet.create(b);
if (v == null) throw new IllegalStateException("Null BitArray returned.");
instanceFilterMasks.put(ci, v);
}
return v;
}
示例2: getStaticFilterMask
import gov.nasa.jpf.util.FinalBitSet; //导入依赖的package包/类
protected FinalBitSet getStaticFilterMask(ClassInfo ci) {
FinalBitSet v = staticFilterMasks.get(ci);
if (v == null) {
BitArray b = new BitArray(ci.getStaticDataSize());
b.setAll();
for (FieldInfo fi : filter.getMatchedStaticFields(ci)) {
int start = fi.getStorageOffset();
int end = start + fi.getStorageSize();
for (int i = start; i < end; i++) {
b.clear(i);
}
}
v = FinalBitSet.create(b);
if (v == null) throw new IllegalStateException("Null BitArray returned.");
staticFilterMasks.put(ci, v);
}
return v;
}
示例3: processNamedFields
import gov.nasa.jpf.util.FinalBitSet; //导入依赖的package包/类
protected void processNamedFields (ClassInfo ci, Fields fields){
FinalBitSet filtered = getInstanceFilterMask(ci);
FinalBitSet refs = getInstanceRefMask(ci);
// using a block operation probably doesn't buy us much here since
// we would have to blank the filtered slots and then visit the
// non-filtered reference slots, i.e. do two iterations over
// the mask bit sets
int[] values = fields.asFieldSlots();
for (int i = 0; i < values.length; i++) {
if (!filtered.get(i)) {
int v = values[i];
if (refs.get(i)) {
processReference(v);
} else {
buf.add(v);
}
}
}
}
示例4: serializeClass
import gov.nasa.jpf.util.FinalBitSet; //导入依赖的package包/类
protected void serializeClass (StaticElementInfo sei){
buf.add(sei.getStatus());
Fields fields = sei.getFields();
ClassInfo ci = sei.getClassInfo();
FinalBitSet filtered = getStaticFilterMask(ci);
FinalBitSet refs = getStaticRefMask(ci);
int max = ci.getStaticDataSize();
for (int i = 0; i < max; i++) {
if (!filtered.get(i)) {
int v = fields.getIntValue(i);
if (refs.get(i)) {
processReference(v);
} else {
buf.add(v);
}
}
}
}
示例5: processNamedFields
import gov.nasa.jpf.util.FinalBitSet; //导入依赖的package包/类
@Override
protected void processNamedFields(ClassInfo ci, Fields fields) {
FinalBitSet filtered = getInstanceFilterMask(ci);
int nFields = ci.getNumberOfInstanceFields();
int[] slotValues = fields.asFieldSlots(); // for non-attributed fields
for (int i = 0; i < nFields; i++) {
FieldInfo fi = ci.getInstanceField(i);
if (declaredFieldsOnly && fi.getClassInfo() != ci) {
continue;
}
processField(fields, slotValues, fi, filtered);
}
}
示例6: serializeClass
import gov.nasa.jpf.util.FinalBitSet; //导入依赖的package包/类
@Override
protected void serializeClass (StaticElementInfo sei) {
ClassInfo ci = sei.getClassInfo();
Fields fields = sei.getFields();
if (StringSetMatcher.isMatch(ci.getName(), includeClasses, excludeClasses)) {
buf.add(sei.getStatus());
FinalBitSet filtered = getStaticFilterMask(ci);
int[] slotValues = fields.asFieldSlots();
for (FieldInfo fi : ci.getDeclaredStaticFields()) {
processField(fields, slotValues, fi, filtered);
}
} else {
// ignored class, but still process references to extract live objects
processNamedStaticReferenceFields(ci, fields);
}
}
示例7: getInstanceRefMask
import gov.nasa.jpf.util.FinalBitSet; //导入依赖的package包/类
protected FinalBitSet getInstanceRefMask(ClassInfo ci) {
FinalBitSet v = instanceRefMasks.get(ci);
if (v == null) {
BitArray b = new BitArray(ci.getInstanceDataSize());
for (FieldInfo fi : filter.getMatchedInstanceFields(ci)) {
if (fi.isReference()) {
b.set(fi.getStorageOffset());
}
}
v = FinalBitSet.create(b);
if (v == null) throw new IllegalStateException("Null BitArray returned.");
instanceRefMasks.put(ci, v);
}
return v;
}
示例8: getStaticRefMask
import gov.nasa.jpf.util.FinalBitSet; //导入依赖的package包/类
protected FinalBitSet getStaticRefMask(ClassInfo ci) {
FinalBitSet v = staticRefMasks.get(ci);
if (v == null) {
BitArray b = new BitArray(ci.getStaticDataSize());
for (FieldInfo fi : filter.getMatchedStaticFields(ci)) {
if (fi.isReference()) {
b.set(fi.getStorageOffset());
}
}
v = FinalBitSet.create(b);
if (v == null) throw new IllegalStateException("Null BitArray returned.");
staticRefMasks.put(ci, v);
}
return v;
}
示例9: processNamedInstanceReferenceFields
import gov.nasa.jpf.util.FinalBitSet; //导入依赖的package包/类
protected void processNamedInstanceReferenceFields(ClassInfo ci, Fields fields) {
FinalBitSet filtered = getInstanceFilterMask(ci);
FinalBitSet refs = getInstanceRefMask(ci);
int[] slotValues = fields.asFieldSlots(); // for non-attributed fields
for (int i = 0; i < slotValues.length; i++) {
if (!filtered.get(i)) {
if (refs.get(i)) {
processReference(slotValues[i]);
}
}
}
}
示例10: processNamedStaticReferenceFields
import gov.nasa.jpf.util.FinalBitSet; //导入依赖的package包/类
protected void processNamedStaticReferenceFields(ClassInfo ci, Fields fields) {
FinalBitSet filtered = getStaticFilterMask(ci);
FinalBitSet refs = getStaticRefMask(ci);
int[] slotValues = fields.asFieldSlots(); // for non-attributed fields
for (int i = 0; i < slotValues.length; i++) {
if (!filtered.get(i)) {
if (refs.get(i)) {
processReference(slotValues[i]);
}
}
}
}
示例11: process
import gov.nasa.jpf.util.FinalBitSet; //导入依赖的package包/类
@Override
public void process (ElementInfo ei) {
super.process( ei);
FinalBitSet filtered = !ei.isArray() ? getInstanceFilterMask(ei.getClassInfo()) : null;
os.print(ei, filtered);
os.println();
}
示例12: serializeClass
import gov.nasa.jpf.util.FinalBitSet; //导入依赖的package包/类
@Override
protected void serializeClass (StaticElementInfo sei){
super.serializeClass(sei);
FinalBitSet filtered = getStaticFilterMask(sei.getClassInfo());
os.print(sei, filtered);
os.println();
}
示例13: printFields
import gov.nasa.jpf.util.FinalBitSet; //导入依赖的package包/类
protected void printFields (ElementInfo ei, FieldInfo[] fields, FinalBitSet filterMask){
if (fields != null){
for (int i = 0; i < fields.length; i++) {
if (i > 0) {
ps.print(',');
}
print(ei, fields[i], (filterMask != null && filterMask.get(i)));
}
}
}
示例14: print
import gov.nasa.jpf.util.FinalBitSet; //导入依赖的package包/类
public void print (ElementInfo ei, FinalBitSet filterMask){
boolean isObject = ei.isObject();
ClassInfo ci = ei.getClassInfo();
int ref = (useSid) ? ei.getSerializationId() : ei.getObjectRef();
ps.printf("@%x ", ref);
if (isObject){
ps.print("object ");
if (ei.isArray()){
ps.print( Types.getTypeName(ci.getName()));
} else {
ps.print(ci.getName());
}
} else {
ps.print("class ");
ps.print(ci.getName());
}
ps.print(':');
if (isObject){
if (ei.isArray()){
ps.print('[');
ei.getArrayFields().printElements(ps, maxElements);
ps.print(']');
} else {
ps.print('{');
printFields(ei, ci.getInstanceFields(), filterMask);
ps.print('}');
}
} else {
ps.print('{');
printFields( ei, ci.getDeclaredStaticFields(), filterMask);
ps.print('}');
}
}
示例15: print
import gov.nasa.jpf.util.FinalBitSet; //导入依赖的package包/类
public void print (ElementInfo ei, FinalBitSet filterMask){
boolean isObject = ei.isObject();
ClassInfo ci = ei.getClassInfo();
int ref = (useSid) ? ei.getSid() : ei.getObjectRef();
ps.printf("@%x ", ref);
if (isObject){
ps.print("object ");
if (ei.isArray()){
ps.print( Types.getTypeName(ci.getName()));
} else {
ps.print(ci.getName());
}
} else {
ps.print("class ");
ps.print(ci.getName());
}
ps.print(':');
if (isObject){
if (ei.isArray()){
ps.print('[');
ei.getArrayFields().printElements(ps, maxElements);
ps.print(']');
} else {
ps.print('{');
printFields(ei, ci.getInstanceFields(), filterMask);
ps.print('}');
}
} else {
ps.print('{');
printFields( ei, ci.getDeclaredStaticFields(), filterMask);
ps.print('}');
}
}