本文整理匯總了Java中com.google.common.collect.Table.Cell.getValue方法的典型用法代碼示例。如果您正苦於以下問題:Java Cell.getValue方法的具體用法?Java Cell.getValue怎麽用?Java Cell.getValue使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.google.common.collect.Table.Cell
的用法示例。
在下文中一共展示了Cell.getValue方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: run
import com.google.common.collect.Table.Cell; //導入方法依賴的package包/類
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++;
}
}
}
}
示例2: populateFromFlows
import com.google.common.collect.Table.Cell; //導入方法依賴的package包/類
private void populateFromFlows(DynamicFlowGraph flowGraph) {
int eid = 0;
for(Cell<Integer, Integer, Integer> edge : flowGraph.getEdges()) {
int from = edge.getRowKey();
int to = edge.getColumnKey();
if(!jungGraph.containsVertex(from)) {
jungGraph.addVertex(from);
}
if(!jungGraph.containsVertex(to)) {
jungGraph.addVertex(to);
}
int edgeCount = edge.getValue();
for(int i = 0; i < edgeCount; i += 1) {
jungGraph.addEdge(eid, from, to, EdgeType.DIRECTED);
eid += 1;
}
}
}
示例3: initGraphicGraph
import com.google.common.collect.Table.Cell; //導入方法依賴的package包/類
public void initGraphicGraph() {
int uniqId = 0;
for(Cell<Integer, Integer, Integer> edge : flowGraph.getEdges()) {
double weight = edge.getValue();
System.out.format("%s %s %s\n", edge.getRowKey(), edge.getColumnKey(), weight);
String fromId = String.valueOf(edge.getRowKey());
String toId = String.valueOf(edge.getColumnKey());
Node from = this.addNode(fromId);
Node to = this.addNode(toId);
int id = uniqId++;
addEdge(from, to, id);
}
weighEdges();
}
示例4: readAll
import com.google.common.collect.Table.Cell; //導入方法依賴的package包/類
public DynamicFlowGraph readAll(File ... rossalCsvs) {
DynamicFlowGraph graph = new DynamicFlowGraph();
for(File csv : rossalCsvs) {
if(csv == null || !csv.exists() || !csv.isFile()
|| !csv.getName().endsWith(".csv")) {
continue;
}
DynamicFlowGraph tempGraph = read(csv);
for(Cell<Integer, Integer, Integer> edge : tempGraph.getEdges()) {
int fromId = edge.getRowKey();
SourceLineNode from = tempGraph.getNode(fromId);
from = graph.addNode(SourceLineNode.clone(from));
int toId = edge.getColumnKey();
SourceLineNode to = tempGraph.getNode(toId);
to = graph.addNode(SourceLineNode.clone(to));
int count = edge.getValue();
graph.addEdge(from, to, count);
}
}
return graph;
}
示例5: modify
import com.google.common.collect.Table.Cell; //導入方法依賴的package包/類
@Override
public void modify(Object o, String property, Object value) {
// int columnIndex = Arrays.asList(columnNames).indexOf(property);
if (property.equals(columnNames[SIZE])) {
String intString = (String) value;
if (intString.matches("[+]?\\d+")) {
TableItem item = (TableItem) o;
@SuppressWarnings("unchecked")
Cell<Pair<String, String>, Pair<String, String>, Integer> element = (Cell<Pair<String, String>, Pair<String, String>, Integer>) item
.getData();
int oldValue = element.getValue();
int newValue = Integer.parseInt(intString);
if (oldValue != newValue) {
Pair<String, String> src = element.getRowKey();
Pair<String, String> tgt = element.getColumnKey();
bufferSize.setSize(src.v1, src.v2, tgt.v1, tgt.v2, newValue);
setDirty(true);
}
viewer.refresh();
}
}
}
示例6: AverageTraceWeighter
import com.google.common.collect.Table.Cell; //導入方法依賴的package包/類
/**
* Create a weighter (average values) given the network weights
*
* @param networkWeights
*/
public AverageTraceWeighter(NetworkWeight networkWeights) {
this.networkWeights = networkWeights;
weightTable = HashBasedTable.create();
varianceTable = HashBasedTable.create();
for (Cell<String, String, ClockCycles> cell : networkWeights.asTable().cellSet()) {
String actor = cell.getRowKey();
String action = cell.getColumnKey();
ClockCycles w = cell.getValue();
double avg = w.getMeanClockCycles();
double min = Math.min(w.getMinClockCycles(), avg);
double max = Math.max(avg, w.getMaxClockCycles());
double variance = Math.pow(((max - min) / 6.0), 2);
weightTable.put(actor, action, avg);
varianceTable.put(actor, action, variance);
}
}
示例7: NormalDistributionTraceWeighter
import com.google.common.collect.Table.Cell; //導入方法依賴的package包/類
/**
* Create a normal distribution weighter given the network weights
*
* @param networkWeights
*/
public NormalDistributionTraceWeighter(NetworkWeight networkWeights) {
this.networkWeights = networkWeights;
weightTable = HashBasedTable.create();
varianceTable = HashBasedTable.create();
for (Cell<String, String, ClockCycles> cell : networkWeights.asTable().cellSet()) {
String actor = cell.getRowKey();
String action = cell.getColumnKey();
ClockCycles w = cell.getValue();
double avg = w.getMeanClockCycles();
double min = Math.min(w.getMinClockCycles(), avg);
double max = Math.max(avg, w.getMaxClockCycles());
double weight = (min + 4 * avg + max) / 6.0;
double variance = Math.pow(((max - min) / 6.0), 2);
weightTable.put(actor, action, weight);
varianceTable.put(actor, action, variance);
}
}
示例8: getPrecedenceVariableValues
import com.google.common.collect.Table.Cell; //導入方法依賴的package包/類
private ImmutableTable<V, V, Double> getPrecedenceVariableValues(
VariableSet.VariableExtractor variableExtractor) {
ImmutableTable.Builder<V, V, Double> ans = ImmutableTable.builder();
List<Cell<V, V, IloNumVar>> varsAsList = Lists
.newArrayList(this.precedenceVariables.cellSet());
IloNumVar[] varArray = new IloNumVar[varsAsList.size()];
int i = 0;
for (Cell<V, V, IloNumVar> cell : varsAsList) {
varArray[i++] = cell.getValue();
}
double[] varVals;
try {
varVals = variableExtractor.getValuesVE(varArray);
} catch (IloException e) {
throw new RuntimeException(e);
}
for (int j = 0; j < varsAsList.size(); j++) {
ans.put(varsAsList.get(j).getRowKey(), varsAsList.get(j).getColumnKey(),
varVals[j]);
}
return ans.build();
}
示例9: printDeltaVars
import com.google.common.collect.Table.Cell; //導入方法依賴的package包/類
private void printDeltaVars(VariableSet.VariableExtractor variableExtractor) {
List<Cell<V, V, IloNumVar>> varsAsList = Lists
.newArrayList(this.precedenceVariables.cellSet());
IloNumVar[] varArray = new IloNumVar[varsAsList.size()];
int i = 0;
for (Cell<V, V, IloNumVar> cell : varsAsList) {
varArray[i++] = cell.getValue();
}
double[] varVals;
try {
varVals = variableExtractor.getValuesVE(varArray);
} catch (IloException e) {
throw new RuntimeException(e);
}
for (int j = 0; j < varsAsList.size(); j++) {
System.out.println(varsAsList.get(j).getRowKey() + ", "
+ varsAsList.get(j).getColumnKey() + " = " + varVals[j]);
}
}
示例10: valuesIterator
import com.google.common.collect.Table.Cell; //導入方法依賴的package包/類
Iterator<V> valuesIterator() {
return new TransformedIterator<Cell<R, C, V>, V>(cellSet().iterator()) {
@Override
V transform(Cell<R, C, V> cell) {
return cell.getValue();
}
};
}
示例11: testKnownUtf8Hashing
import com.google.common.collect.Table.Cell; //導入方法依賴的package包/類
public void testKnownUtf8Hashing() {
for (Cell<HashFunction, String, String> cell : KNOWN_HASHES.cellSet()) {
HashFunction func = cell.getRowKey();
String input = cell.getColumnKey();
String expected = cell.getValue();
assertEquals(
String.format(Locale.ROOT, "Known hash for hash(%s, UTF_8) failed", input),
expected,
func.hashString(input, UTF_8).toString());
}
}
示例12: main
import com.google.common.collect.Table.Cell; //導入方法依賴的package包/類
public static void main(String[] args) throws
IOException, NoSuchFieldException, IllegalArgumentException, IllegalAccessException {
System.out.println("Reading dynamic graph...");
DynamicFlowGraph dynamicFlowGraph = Cerebro.getDynamicFlowGraph(args);
final String subject = args[args.length - 1];
System.out.println(subject);
System.out.println("Computing layout, visual clusters, and communities...");
Cerebro.analyzeDynamicFlow(subject, dynamicFlowGraph);
dynamicFlowGraph.spitDynamicFlowGraph(System.out);
DynamicDisplay display = init(DEFAULT_TITLE, dynamicFlowGraph);
for(Cell<Integer, Integer, Integer> edge : dynamicFlowGraph.getEdges()) {
int fromId = edge.getRowKey();
int toId = edge.getColumnKey();
SourceLineNode from = dynamicFlowGraph.getNode(fromId);
SourceLineNode to = dynamicFlowGraph.getNode(toId);
double weight = edge.getValue();
System.out.format("%s %s %s\n", fromId, toId, weight);
if(Double.isNaN(from.x)) {
display.showDependence(fromId, toId, weight);
} else {
display.showDependence(fromId, from.x, from.y, toId, to.x, to.y, weight);
}
}
display.colorNodes();
display.showEdges();
startCli(display);
System.exit(0);
}
示例13: spitDynamicFlowGraph
import com.google.common.collect.Table.Cell; //導入方法依賴的package包/類
public void spitDynamicFlowGraph(PrintStream out) {
int count = 0;
out.println("{\"nodes\":[");
for(SourceLineNode node : this.nodes) {
spitJson(out, node);
if(count >= this.nodes.size() - 1) continue;
out.println(",");
count += 1;
}
out.println("],");
count = 0;
out.println("\"links\":[");
for(Cell<Integer, Integer, Integer> edge : edges.cellSet()) {
SourceLineNode start = this.getNode(edge.getRowKey());
SourceLineNode end = this.getNode(edge.getColumnKey());
double weight = (double) edge.getValue();
SourceLineFlow flow = SourceLineFlow.flow(start, end, weight);
spitJson(out, flow);
if(count >= this.edges.size() - 1) continue;
out.println(",");
count += 1;
}
out.println("],");
count = 0;
out.println("\"traces\":[");
for(FlowIdent i : flows) {
spitJson(out, i);
if(count >= this.flows.size() - 1) continue;
out.println(",");
count += 1;
}
out.println("]}");
}
示例14: toList
import com.google.common.collect.Table.Cell; //導入方法依賴的package包/類
public List<Set<IPosition>> toList() {
final List<Set<IPosition>> list = Lists.newArrayList();
for (final Cell<IPosition, Polyomino, List<Set<IPosition>>> object : this.options.cellSet()) {
final List<Set<IPosition>> value = object.getValue();
for (final Set<IPosition> positions : value) {
list.add(positions);
}
}
return list;
}
示例15: contains
import com.google.common.collect.Table.Cell; //導入方法依賴的package包/類
@Override public boolean contains(Object obj) {
if (obj instanceof Cell) {
Cell<?, ?, ?> cell = (Cell<?, ?, ?>) obj;
if (!Objects.equal(
cell.getValue(), get(cell.getRowKey(), cell.getColumnKey()))) {
return false;
}
return cell.getValue() != null
|| fromTable.contains(cell.getRowKey(), cell.getColumnKey());
}
return false;
}