Examples of Satisfaction


Examples of org.grouplens.grapht.reflect.Satisfaction

            // don't save to disk if it isn't shared
            entry = new CacheEntry(node, false);
        }

        Component label = node.getLabel();
        Satisfaction satisfaction = label.getSatisfaction();
        if (satisfaction.hasInstance()) {
            return node;
        }
        Object obj;
        try {
            obj = entry.getObject(node);
        } catch (IOException e) {
            throw new RuntimeException("Cache I/O error", e);
        }

        Satisfaction instanceSat;
        if (obj == null) {
            instanceSat = Satisfactions.nullOfType(satisfaction.getErasedType());
        } else {
            instanceSat = Satisfactions.instance(obj);
        }
View Full Code Here

Examples of org.grouplens.grapht.reflect.Satisfaction

    private static final Logger logger = LoggerFactory.getLogger(SimulationNodeProcessor.class);

    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
View Full Code Here

Examples of org.grouplens.grapht.reflect.Satisfaction

        instantiator = inst;
    }

    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);
        }
View Full Code Here

Examples of org.grouplens.grapht.reflect.Satisfaction

     * @param graph The graph to check.
     * @throws org.grouplens.lenskit.core.RecommenderConfigurationException if the graph has a placeholder satisfaction.
     */
    public static void checkForPlaceholders(DAGNode<Component, Dependency> graph, Logger logger) throws RecommenderConfigurationException {
        Set<DAGNode<Component, Dependency>> placeholders = getPlaceholderNodes(graph);
        Satisfaction sat = null;
        for (DAGNode<Component,Dependency> node: placeholders) {
            Component csat = node.getLabel();
            if (sat == null) {
                sat = csat.getSatisfaction();
            }
View Full Code Here

Examples of org.grouplens.grapht.reflect.Satisfaction

        if (id == null) {
            id = "N" + nodeIds.size();
            nodeIds.put(node, id);
            Component csat = node.getLabel();
            assert csat != null;
            Satisfaction sat = csat.getSatisfaction();
            try {
                tgt = sat.visit(new Visitor(node, id));
            } catch (RuntimeException e) {
                if (e.getCause() instanceof IOException) {
                    throw (IOException) e.getCause();
                } else {
                    throw e;
View Full Code Here

Examples of org.grouplens.grapht.reflect.Satisfaction

                DAGNode<Component, Dependency> targetNode = e.getTail();
                if (q != null && q.annotationType().getAnnotation(Parameter.class) != null) {
                    logger.debug("dumping parameter {}", q);
                    Component tcsat = targetNode.getLabel();
                    assert tcsat != null;
                    Satisfaction tsat = tcsat.getSatisfaction();
                    Object val = tsat.visit(new AbstractSatisfactionVisitor<Object>(null) {
                        @Override
                        public Object visitInstance(Object instance) {
                            return instance;
                        }
                    });
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.