當前位置: 首頁>>代碼示例>>Java>>正文


Java Cell.getValue方法代碼示例

本文整理匯總了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++;
			}
		}
	}
}
 
開發者ID:flankerhqd,項目名稱:JAADAS,代碼行數:20,代碼來源:IDESolver.java

示例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;
    }
  }
}
 
開發者ID:spideruci,項目名稱:cerebro-layout,代碼行數:22,代碼來源:JungCommunityComputer.java

示例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();
}
 
開發者ID:spideruci,項目名稱:cerebro-layout,代碼行數:18,代碼來源:Spine.java

示例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;
}
 
開發者ID:spideruci,項目名稱:cerebro-layout,代碼行數:26,代碼來源:RossalExecCsvReader.java

示例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();

		}
	}

}
 
開發者ID:turnus,項目名稱:turnus,代碼行數:25,代碼來源:BufferSizeEditor.java

示例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);
	}
}
 
開發者ID:turnus,項目名稱:turnus,代碼行數:25,代碼來源:AverageTraceWeighter.java

示例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);
	}
}
 
開發者ID:turnus,項目名稱:turnus,代碼行數:27,代碼來源:NormalDistributionTraceWeighter.java

示例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();
}
 
開發者ID:rma350,項目名稱:kidneyExchange,代碼行數:23,代碼來源:MinWaitingTimeKepSolver.java

示例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]);
    }
  }
 
開發者ID:rma350,項目名稱:kidneyExchange,代碼行數:21,代碼來源:MinWaitingTimeKepSolver.java

示例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();
    }
  };
}
 
開發者ID:zugzug90,項目名稱:guava-mock,代碼行數:9,代碼來源:AbstractTable.java

示例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());
  }
}
 
開發者ID:zugzug90,項目名稱:guava-mock,代碼行數:12,代碼來源:HashingTest.java

示例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);
}
 
開發者ID:spideruci,項目名稱:cerebro-layout,代碼行數:38,代碼來源:Main.java

示例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("]}");
}
 
開發者ID:spideruci,項目名稱:cerebro-layout,代碼行數:36,代碼來源:DynamicFlowGraph.java

示例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;
}
 
開發者ID:arie-benichou,項目名稱:blockplus,代碼行數:11,代碼來源:Options.java

示例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;
}
 
開發者ID:Sellegit,項目名稱:j2objc,代碼行數:13,代碼來源:Tables.java


注:本文中的com.google.common.collect.Table.Cell.getValue方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。