Tabnine Logo
DAGNode.breadthFirstEdges
Code IndexAdd Tabnine to your IDE (free)

How to use
breadthFirstEdges
method
in
org.grouplens.grapht.graph.DAGNode

Best Java code snippets using org.grouplens.grapht.graph.DAGNode.breadthFirstEdges (Showing top 2 results out of 315)

origin: lenskit/lenskit

  /**
   * Find a node with a satisfaction for a specified type. Does a breadth-first
   * search to find the closest matching one.
   *
   * @param type The type to look for.
   * @return A node whose satisfaction is compatible with {@code type}.
   */
  @Nullable
  public static DAGNode<Component,Dependency> findSatisfyingNode(DAGNode<Component,Dependency> graph,
                                  final QualifierMatcher qmatch,
                                  final Class<?> type) {
    Optional<DAGEdge<Component, Dependency>> edge =
        graph.breadthFirstEdges()
           .filter(e -> type.isAssignableFrom(e.getTail()
                             .getLabel()
                             .getSatisfaction()
                             .getErasedType()))
           .filter(e -> qmatch.apply(e.getLabel()
                        .getInitialDesire()
                        .getInjectionPoint()
                        .getQualifier()))
        .findFirst();

    return edge.map(DAGEdge::getTail)
          .orElse(null);
  }
}
origin: org.lenskit/lenskit-core

  /**
   * Find a node with a satisfaction for a specified type. Does a breadth-first
   * search to find the closest matching one.
   *
   * @param type The type to look for.
   * @return A node whose satisfaction is compatible with {@code type}.
   */
  @Nullable
  public static DAGNode<Component,Dependency> findSatisfyingNode(DAGNode<Component,Dependency> graph,
                                  final QualifierMatcher qmatch,
                                  final Class<?> type) {
    Optional<DAGEdge<Component, Dependency>> edge =
        graph.breadthFirstEdges()
           .filter(e -> type.isAssignableFrom(e.getTail()
                             .getLabel()
                             .getSatisfaction()
                             .getErasedType()))
           .filter(e -> qmatch.apply(e.getLabel()
                        .getInitialDesire()
                        .getInjectionPoint()
                        .getQualifier()))
        .findFirst();

    return edge.map(DAGEdge::getTail)
          .orElse(null);
  }
}
org.grouplens.grapht.graphDAGNodebreadthFirstEdges

Popular methods of DAGNode

  • getLabel
    Get the label for this node.
  • getOutgoingEdges
    Get the outgoing edges of this node.
  • getReachableNodes
  • newBuilder
    Construct a new DAG node builder.
  • getOutgoingEdgeWithLabel
  • getSortedNodes
    Topographical sort all nodes reachable from the given root node. Nodes that are farther away, or mor
  • replaceNode
    Replace one node with another in this graph. All edges referencing node are replaced with edges refe
  • <init>
    Construct a new DAG node.
  • copyBuilder
    Create a new builder initialized to build a copy of the specified node.
  • getAdjacentNodes
    Get the nodes that are adjacent to this node (only considering outgoing edges).
  • getIncomingEdgeMap
    Get a multimap of incoming edges. For each node reachable from this node, the map will contain each
  • initializeCaches
    Initialize caches for traversing this node.
  • getIncomingEdgeMap,
  • initializeCaches,
  • singleton,
  • sortVisit,
  • transformEdges

Popular in Java

  • Parsing JSON documents to java classes using gson
  • addToBackStack (FragmentTransaction)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • findViewById (Activity)
  • InputStream (java.io)
    A readable source of bytes.Most clients will use input streams that read data from the file system (
  • MessageFormat (java.text)
    Produces concatenated messages in language-neutral way. New code should probably use java.util.Forma
  • NumberFormat (java.text)
    The abstract base class for all number formats. This class provides the interface for formatting and
  • Locale (java.util)
    Locale represents a language/country/variant combination. Locales are used to alter the presentatio
  • Map (java.util)
    A Map is a data structure consisting of a set of keys and values in which each key is mapped to a si
  • Table (org.hibernate.mapping)
    A relational table
  • Top plugins for Android Studio
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now