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


Java Presence類代碼示例

本文整理匯總了Java中com.google.common.graph.GraphConstants.Presence的典型用法代碼示例。如果您正苦於以下問題:Java Presence類的具體用法?Java Presence怎麽用?Java Presence使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


Presence類屬於com.google.common.graph.GraphConstants包,在下文中一共展示了Presence類的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: copyOf

import com.google.common.graph.GraphConstants.Presence; //導入依賴的package包/類
/** Returns an immutable copy of {@code graph}. */
public static <N> ImmutableGraph<N> copyOf(Graph<N> graph) {
  return (graph instanceof ImmutableGraph)
      ? (ImmutableGraph<N>) graph
      : new ImmutableGraph<N>(new ConfigurableValueGraph<N, Presence>(
          GraphBuilder.from(graph), getNodeConnections(graph), graph.edges().size()));
}
 
開發者ID:zugzug90,項目名稱:guava-mock,代碼行數:8,代碼來源:ImmutableGraph.java

示例2: getNodeConnections

import com.google.common.graph.GraphConstants.Presence; //導入依賴的package包/類
private static <N> ImmutableMap<N, GraphConnections<N, Presence>> getNodeConnections(
    Graph<N> graph) {
  // ImmutableMap.Builder maintains the order of the elements as inserted, so the map will have
  // whatever ordering the graph's nodes do, so ImmutableSortedMap is unnecessary even if the
  // input nodes are sorted.
  ImmutableMap.Builder<N, GraphConnections<N, Presence>> nodeConnections = ImmutableMap.builder();
  for (N node : graph.nodes()) {
    nodeConnections.put(node, connectionsOf(graph, node));
  }
  return nodeConnections.build();
}
 
開發者ID:zugzug90,項目名稱:guava-mock,代碼行數:12,代碼來源:ImmutableGraph.java

示例3: connectionsOf

import com.google.common.graph.GraphConstants.Presence; //導入依賴的package包/類
private static <N> GraphConnections<N, Presence> connectionsOf(Graph<N> graph, N node) {
  Function<Object, Presence> edgeValueFn = Functions.constant(Presence.EDGE_EXISTS);
  return graph.isDirected()
      ? DirectedGraphConnections.ofImmutable(
          graph.predecessors(node), Maps.asMap(graph.successors(node), edgeValueFn))
      : UndirectedGraphConnections.ofImmutable(
          Maps.asMap(graph.adjacentNodes(node), edgeValueFn));
}
 
開發者ID:zugzug90,項目名稱:guava-mock,代碼行數:9,代碼來源:ImmutableGraph.java

示例4: copyOf

import com.google.common.graph.GraphConstants.Presence; //導入依賴的package包/類
/** Returns an immutable copy of {@code graph}. */
public static <N> ImmutableGraph<N> copyOf(Graph<N> graph) {
  return (graph instanceof ImmutableGraph)
      ? (ImmutableGraph<N>) graph
      : new ImmutableGraph<N>(
          new ConfigurableValueGraph<N, Presence>(
              GraphBuilder.from(graph), getNodeConnections(graph), graph.edges().size()));
}
 
開發者ID:google,項目名稱:guava,代碼行數:9,代碼來源:ImmutableGraph.java

示例5: ConfigurableMutableGraph

import com.google.common.graph.GraphConstants.Presence; //導入依賴的package包/類
/** Constructs a {@link MutableGraph} with the properties specified in {@code builder}. */
ConfigurableMutableGraph(AbstractGraphBuilder<? super N> builder) {
  this.backingValueGraph = new ConfigurableMutableValueGraph<N, Presence>(builder);
}
 
開發者ID:zugzug90,項目名稱:guava-mock,代碼行數:5,代碼來源:ConfigurableMutableGraph.java

示例6: putEdge

import com.google.common.graph.GraphConstants.Presence; //導入依賴的package包/類
@Override
public boolean putEdge(N nodeU, N nodeV) {
  return backingValueGraph.putEdgeValue(nodeU, nodeV, Presence.EDGE_EXISTS) == null;
}
 
開發者ID:zugzug90,項目名稱:guava-mock,代碼行數:5,代碼來源:ConfigurableMutableGraph.java


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