Codota Logo
Component.getCachePolicy
Code IndexAdd Codota to your IDE (free)

How to use
getCachePolicy
method
in
org.grouplens.grapht.Component

Best Java code snippets using org.grouplens.grapht.Component.getCachePolicy (Showing top 11 results out of 315)

  • Common ways to obtain Component
private void myMethod () {
Component c =
  • Codota IconDAGNode node;node.getLabel()
  • Smart code suggestions by Codota
}
origin: lenskit/lenskit

  @Override
  public void describe(DAGNode<Component, Dependency> node, DescriptionWriter description) {
    node.getLabel().getSatisfaction().visit(new LabelDescriptionVisitor(description));
    description.putField("cachePolicy", node.getLabel().getCachePolicy().name());
    List<DAGNode<Component, Dependency>> edges =
        node.getOutgoingEdges()
        .stream()
        .sorted(GraphtUtils.DEP_EDGE_ORDER)
        .map(DAGEdge::getTail)
        .collect(Collectors.toList());
    description.putList("dependencies", edges, INSTANCE);
  }
}
origin: lenskit/lenskit

if (label.getCachePolicy() == CachePolicy.NEW_INSTANCE) {
  logger.trace("node {} not shareable because it has a new-instance cache policy", node);
  return false;
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

  instanceSat = Satisfactions.instance(obj);
Component newLabel = Component.create(instanceSat, label.getCachePolicy());
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.lenskit/lenskit-core

if (label.getCachePolicy() == CachePolicy.NEW_INSTANCE) {
  logger.trace("node {} not shareable because it has a new-instance cache policy", node);
  return false;
origin: org.grouplens.lenskit/lenskit-eval

  @Override
  public void describe(DAGNode<Component, Dependency> node, DescriptionWriter description) {
    node.getLabel().getSatisfaction().visit(new LabelDescriptionVisitor(description));
    description.putField("cachePolicy", node.getLabel().getCachePolicy().name());
    List<DAGNode<Component, Dependency>> edges =
        Lists.transform(GraphtUtils.DEP_EDGE_ORDER.sortedCopy(node.getOutgoingEdges()),
                DAGEdge.<Component,Dependency>extractTail());
    description.putList("dependencies", edges, INSTANCE);
  }
}
origin: org.grouplens.grapht/grapht

CachePolicy policy = node.getLabel().getCachePolicy();
if (policy.equals(CachePolicy.NO_PREFERENCE)) {
  policy = defaultCachePolicy;
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

  instanceSat = Satisfactions.instance(obj);
Component newLabel = Component.create(instanceSat, label.getCachePolicy());
org.grouplens.graphtComponentgetCachePolicy

Popular methods of Component

  • create
    Create a new Component wrapping the given satisfaction and cache policy. The injector is responsible
  • getSatisfaction
  • <init>
  • equals

Popular in Java

  • Reading from database using SQL prepared statement
  • onCreateOptionsMenu (Activity)
  • notifyDataSetChanged (ArrayAdapter)
  • setRequestProperty (URLConnection)
    Sets the general request property. If a property with the key already exists, overwrite its value wi
  • FileOutputStream (java.io)
    A file output stream is an output stream for writing data to aFile or to a FileDescriptor. Whether
  • Permission (java.security)
    Abstract class for representing access to a system resource. All permissions have a name (whose inte
  • Collections (java.util)
    This class consists exclusively of static methods that operate on or return collections. It contains
  • TreeSet (java.util)
    A NavigableSet implementation based on a TreeMap. The elements are ordered using their Comparable, o
  • IOUtils (org.apache.commons.io)
    General IO stream manipulation utilities. This class provides static utility methods for input/outpu
  • Logger (org.apache.log4j)
    This is the central class in the log4j package. Most logging operations, except configuration, are d
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