Codota Logo
DAGNodeBuilder
Code IndexAdd Codota to your IDE (free)

How to use
DAGNodeBuilder
in
org.grouplens.grapht.graph

Best Java code snippets using org.grouplens.grapht.graph.DAGNodeBuilder (Showing top 15 results out of 315)

  • Common ways to obtain DAGNodeBuilder
private void myMethod () {
DAGNodeBuilder d =
  • Codota IconDAGNodeBuilder dAGNodeBuilder;DAGEdge dAGEdge;DAGEdge dAGEdge2;dAGNodeBuilder.addEdge(dAGEdge.getTail(), dAGEdge2.getLabel())
  • Smart code suggestions by Codota
}
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: org.grouplens.grapht/grapht

/**
 * Construct a new DAG node builder.
 * @param label The node label.
 * @param <V> The type of node labels.
 * @param <E> The type of edge labels.
 * @return The DAG node builder.
 */
public static <V,E> DAGNodeBuilder<V,E> newBuilder(V label) {
  return new DAGNodeBuilder<V, E>(label);
}
origin: org.grouplens.grapht/grapht

bld.setLabel(sat);
logger.debug("Adding new node to merged graph for satisfaction: {}", sat);
  bld.addEdge(filtered, edge.getLabel());
  newNode = bld.build();
} else {
origin: org.grouplens.grapht/grapht

/**
 * Add an edge.
 * @param target The target node.
 * @param label The edge label.
 * @return The builder (for chaining).
 */
@Nonnull
public DAGNodeBuilder<V,E> addEdge(@Nonnull DAGNode<V,E> target,
                  @Nonnull E label) {
  Preconditions.checkNotNull(target, "edge target");
  Preconditions.checkNotNull(label, "edge label");
  return addEdge(Pair.of(target, label));
}
origin: org.grouplens.grapht/grapht

nodeBuilder.setLabel(result.makeSatisfaction());
for (Desire d: result.satisfaction.getDependencies()) {
  nodeBuilder.addEdge(resolveFully(d, newContext, deferQueue));
node = nodeBuilder.build();
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: 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

/**
 * Construct a new DAG node builder.
 * @param <V> The type of node labels.
 * @param <E> The type of edge labels.
 * @return The DAG node builder.
 */
public static <V,E> DAGNodeBuilder<V,E> newBuilder() {
  return new DAGNodeBuilder<V, E>();
}
origin: lenskit/lenskit

    bld.addEdge(edge.getTail(), edge.getLabel());
return bld.build();
origin: org.grouplens.grapht/grapht

for (DAGEdge<V,E> edge: outgoingEdges) {
  DAGNode<V,E> newTail = edge.getTail().replaceNode(node, replacement, memory);
  bld.addEdge(newTail, edge.getLabel());
DAGNode<V,E> repl = bld.build();
memory.put(this, repl);
return repl;
origin: org.grouplens.grapht/grapht

      intact.add(transformedEdge);
    } else {
      builder.addEdge(transformedEdge.getTail(), transformedEdge.getLabel());
      builder = newBuilder(label);
      for (DAGEdge<V,E> done: intact) {
        builder.addEdge(done.getTail(), done.getLabel());
    builder.addEdge(transformedEdge.getTail(), transformedEdge.getLabel());
  return builder.build();
} else {
  return this;
origin: org.grouplens.grapht/grapht

          .addEdge(mergePool.merge(rootNode.getLeft()),
              rootNode.getRight())
          .build();
} else if (graph.getReachableNodes().contains(parent)) {
              .addEdge(merged, result.getRight())
              .build();
      replaceNode(parent, newP);
      parent = newP;
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.lenskit/lenskit-eval

    bld.addEdge(edge.getTail(), edge.getLabel());
return bld.build();
org.grouplens.grapht.graphDAGNodeBuilder

Javadoc

A builder for DAGNode. You can create one with DAGNode#newBuilder()or DAGNode#newBuilder(Object).

Most used methods

  • addEdge
    Add an edge.
  • build
  • <init>
  • setLabel
    Set the node's label.

Popular in Java

  • Reading from database using SQL prepared statement
  • setScale (BigDecimal)
  • startActivity (Activity)
  • scheduleAtFixedRate (Timer)
    Schedules the specified task for repeated fixed-rate execution, beginning after the specified delay.
  • IOException (java.io)
    Signals that an I/O exception of some sort has occurred. This class is the general class of exceptio
  • SocketException (java.net)
    This SocketException may be thrown during socket creation or setting options, and is the superclass
  • URLEncoder (java.net)
    This class is used to encode a string using the format required by application/x-www-form-urlencoded
  • HashMap (java.util)
    HashMap is an implementation of Map. All optional operations are supported.All elements are permitte
  • LinkedHashMap (java.util)
    Hash table and linked list implementation of the Map interface, with predictable iteration order. Th
  • Queue (java.util)
    A collection designed for holding elements prior to processing. Besides basic java.util.Collection o
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now