下面列出了com.google.common.collect.Table.Cell#getRowKey ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。
public void dumpResults() {
try {
PrintWriter out = new PrintWriter(new FileOutputStream("ideSolverDump"+System.currentTimeMillis()+".csv"));
List<String> res = new ArrayList<String>();
for(Cell<Unit, D, V> entry: val.cellSet()) {
SootMethod methodOf = (SootMethod) icfg.getMethodOf(entry.getRowKey());
PatchingChain<Unit> units = methodOf.getActiveBody().getUnits();
int i=0;
for (Unit unit : units) {
if(unit==entry.getRowKey())
break;
i++;
}
res.add(methodOf+";"+entry.getRowKey()+"@"+i+";"+entry.getColumnKey()+";"+entry.getValue());
}
Collections.sort(res);
for (String string : res) {
out.println(string);
}
out.flush();
out.close();
} catch (FileNotFoundException e) {
e.printStackTrace();
}
}
public void run() {
int sectionSize = (int) Math.floor(values.length / numThreads) + numThreads;
for(int i = sectionSize * num; i < Math.min(sectionSize * (num+1),values.length); i++) {
N n = values[i];
for(N sP: icfg.getStartPointsOf(icfg.getMethodOf(n))) {
Set<Cell<D, D, EdgeFunction<V>>> lookupByTarget;
lookupByTarget = jumpFn.lookupByTarget(n);
for(Cell<D, D, EdgeFunction<V>> sourceValTargetValAndFunction : lookupByTarget) {
D dPrime = sourceValTargetValAndFunction.getRowKey();
D d = sourceValTargetValAndFunction.getColumnKey();
EdgeFunction<V> fPrime = sourceValTargetValAndFunction.getValue();
synchronized (val) {
setVal(n,d,valueLattice.join(val(n,d),fPrime.computeTarget(val(sP,dPrime))));
}
flowFunctionApplicationCount++;
}
}
}
}
public void dumpResults() {
try {
PrintWriter out = new PrintWriter(new FileOutputStream("ideSolverDump" + System.currentTimeMillis() + ".csv"));
List<SortableCSVString> res = new ArrayList<SortableCSVString>();
for (Cell<Unit, D, ?> entry : val.cellSet()) {
SootMethod methodOf = (SootMethod) icfg.getMethodOf(entry.getRowKey());
PatchingChain<Unit> units = methodOf.getActiveBody().getUnits();
int i = 0;
for (Unit unit : units) {
if (unit == entry.getRowKey())
break;
i++;
}
res.add(new SortableCSVString(methodOf + ";" + entry.getRowKey() + "@" + i + ";" + entry.getColumnKey() + ";" + entry.getValue(), i));
}
Collections.sort(res);
// replacement is bugfix for excel view:
for (SortableCSVString string : res) {
out.println(string.value.replace("\"", "'"));
}
out.flush();
out.close();
} catch (FileNotFoundException e) {
e.printStackTrace();
}
}
private void mergeResult(Table<String, String, Set<String>> groupRolePrivilegeTableTemp) {
for (Cell<String, String, Set<String>> cell : groupRolePrivilegeTableTemp.cellSet()) {
String groupName = cell.getRowKey();
String roleName = cell.getColumnKey();
Set<String> privileges = groupRolePrivilegeTable.get(groupName, roleName);
if (privileges == null) {
privileges = new HashSet<String>();
groupRolePrivilegeTable.put(groupName, roleName, privileges);
}
privileges.addAll(cell.getValue());
}
}