当前位置: 首页>>代码示例>>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;未经允许,请勿转载。