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

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

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

origin: lenskit/lenskit

  public DAGNode<Component, Dependency> processNode(@Nonnull DAGNode<Component, Dependency> node, @Nonnull DAGNode<Component, Dependency> original) {
    Component label = node.getLabel();
    if (!label.getSatisfaction().hasInstance()) {
      Satisfaction instanceSat = Satisfactions.nullOfType(label.getSatisfaction().getErasedType());
      Component newLbl = Component.create(instanceSat,
                        label.getCachePolicy());
      // build new node with replacement label
      DAGNodeBuilder<Component,Dependency> bld = DAGNode.newBuilder(newLbl);
      // retain all non-transient edges
      for (DAGEdge<Component,Dependency> edge: node.getOutgoingEdges()) {
        if (!GraphtUtils.edgeIsTransient(edge)) {
          bld.addEdge(edge.getTail(), edge.getLabel());
        }
      }
      DAGNode<Component,Dependency> repl = bld.build();
      logger.debug("simulating instantiation of {}", node);
      return repl;
    } else {
      return node;
    }
  }
}
origin: lenskit/lenskit

DAGNodeBuilder<Component,Dependency> bld = DAGNode.newBuilder(newLabel);
origin: lenskit/lenskit

  public DAGNode<Component, Dependency> processNode(@Nonnull DAGNode<Component, Dependency> node, @Nonnull DAGNode<Component, Dependency> original) {
    Component label = node.getLabel();
    Satisfaction satisfaction = label.getSatisfaction();
    if (satisfaction.hasInstance()) {
      return node;
    }
    Object obj = instantiator.apply(node);

    Satisfaction instanceSat;
    if (obj == null) {
      instanceSat = Satisfactions.nullOfType(satisfaction.getErasedType());
    } else {
      instanceSat = Satisfactions.instance(obj);
    }
    Component newLabel = Component.create(instanceSat, label.getCachePolicy());
    // build new node with replacement label
    DAGNodeBuilder<Component,Dependency> bld = DAGNode.newBuilder(newLabel);
    // retain all non-transient edges
    for (DAGEdge<Component, Dependency> edge: node.getOutgoingEdges()) {
      if (!GraphtUtils.edgeIsTransient(edge)) {
        bld.addEdge(edge.getTail(), edge.getLabel());
      }
    }
    return bld.build();
  }
}
origin: org.grouplens.grapht/grapht

DAGNodeBuilder<V,E> bld = newBuilder(label);
for (DAGEdge<V,E> edge: outgoingEdges) {
  DAGNode<V,E> newTail = edge.getTail().replaceNode(node, replacement, memory);
origin: org.grouplens.grapht/grapht

if (newNode == null) {
  DAGNodeBuilder<V,E> bld = DAGNode.newBuilder();
origin: org.grouplens.grapht/grapht

/**
 * Create a new builder initialized to build a copy of the specified node.
 * @param node The node to copy.
 * @param <V> The type of node labels.
 * @param <E> The type of edge labels.
 * @return A new builder initialized with the labels and edges of {@code node}.
 */
public static <V,E> DAGNodeBuilder<V,E> copyBuilder(DAGNode<V,E> node) {
  DAGNodeBuilder<V,E> bld = newBuilder(node.getLabel());
  for (DAGEdge<V,E> edge: node.getOutgoingEdges()) {
    bld.addEdge(edge.getTail(), edge.getLabel());
  }
  return bld;
}
origin: org.lenskit/lenskit-core

  public DAGNode<Component, Dependency> processNode(@Nonnull DAGNode<Component, Dependency> node, @Nonnull DAGNode<Component, Dependency> original) {
    Component label = node.getLabel();
    if (!label.getSatisfaction().hasInstance()) {
      Satisfaction instanceSat = Satisfactions.nullOfType(label.getSatisfaction().getErasedType());
      Component newLbl = Component.create(instanceSat,
                        label.getCachePolicy());
      // build new node with replacement label
      DAGNodeBuilder<Component,Dependency> bld = DAGNode.newBuilder(newLbl);
      // retain all non-transient edges
      for (DAGEdge<Component,Dependency> edge: node.getOutgoingEdges()) {
        if (!GraphtUtils.edgeIsTransient(edge)) {
          bld.addEdge(edge.getTail(), edge.getLabel());
        }
      }
      DAGNode<Component,Dependency> repl = bld.build();
      logger.debug("simulating instantiation of {}", node);
      return repl;
    } else {
      return node;
    }
  }
}
origin: org.lenskit/lenskit-core

  public DAGNode<Component, Dependency> processNode(@Nonnull DAGNode<Component, Dependency> node, @Nonnull DAGNode<Component, Dependency> original) {
    Component label = node.getLabel();
    Satisfaction satisfaction = label.getSatisfaction();
    if (satisfaction.hasInstance()) {
      return node;
    }
    Object obj = instantiator.apply(node);

    Satisfaction instanceSat;
    if (obj == null) {
      instanceSat = Satisfactions.nullOfType(satisfaction.getErasedType());
    } else {
      instanceSat = Satisfactions.instance(obj);
    }
    Component newLabel = Component.create(instanceSat, label.getCachePolicy());
    // build new node with replacement label
    DAGNodeBuilder<Component,Dependency> bld = DAGNode.newBuilder(newLabel);
    // retain all non-transient edges
    for (DAGEdge<Component, Dependency> edge: node.getOutgoingEdges()) {
      if (!GraphtUtils.edgeIsTransient(edge)) {
        bld.addEdge(edge.getTail(), edge.getLabel());
      }
    }
    return bld.build();
  }
}
origin: org.grouplens.grapht/grapht

} else {
  DAGNodeBuilder<Component,Dependency> nodeBuilder = DAGNode.newBuilder();
  nodeBuilder.setLabel(result.makeSatisfaction());
  for (Desire d: result.satisfaction.getDependencies()) {
origin: org.grouplens.grapht/grapht

builder = newBuilder(label);
for (DAGEdge<V,E> done: intact) {
  builder.addEdge(done.getTail(), done.getLabel());
origin: org.grouplens.lenskit/lenskit-eval

DAGNodeBuilder<Component,Dependency> bld = DAGNode.newBuilder(newLabel);
org.grouplens.grapht.graphDAGNodenewBuilder

Javadoc

Construct a new DAG node builder.

Popular methods of DAGNode

  • getLabel
    Get the label for this node.
  • getOutgoingEdges
    Get the outgoing edges of this node.
  • getReachableNodes
  • 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
  • breadthFirstEdges
  • <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

  • Reading from database using SQL prepared statement
  • scheduleAtFixedRate (ScheduledExecutorService)
  • getResourceAsStream (ClassLoader)
  • getSystemService (Context)
  • Socket (java.net)
    Provides a client-side TCP socket.
  • DecimalFormat (java.text)
    A concrete subclass of NumberFormat that formats decimal numbers. It has a variety of features desig
  • ConcurrentHashMap (java.util.concurrent)
    A plug-in replacement for JDK1.5 java.util.concurrent.ConcurrentHashMap. This version is based on or
  • ReentrantLock (java.util.concurrent.locks)
    A reentrant mutual exclusion Lock with the same basic behavior and semantics as the implicit monitor
  • DataSource (javax.sql)
    An interface for the creation of Connection objects which represent a connection to a database. This
  • Options (org.apache.commons.cli)
    Main entry-point into the library. Options represents a collection of Option objects, which describ
  • CodeWhisperer alternatives
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