Package com.asakusafw.compiler.operator.OperatorMethodDescriptor

Examples of com.asakusafw.compiler.operator.OperatorMethodDescriptor.Builder


        });
        if (a.hasError()) {
            return null;
        }

        Builder builder = new Builder(getTargetAnnotationType(), context);
        builder.addAttribute(a.getObservationCount());
        builder.setDocumentation(a.getExecutableDocument());
        builder.addInput(
                a.getParameterDocument(0),
                a.getParameterName(0),
                a.getParameterType(0).getType(),
                0);
        builder.addOutput(
                "結果",
                annotation.outputPort(),
                a.getParameterType(0).getType(),
                a.getParameterName(0),
                0);
        for (int i = 1, n = a.countParameters(); i < n; i++) {
            builder.addParameter(
                    a.getParameterDocument(i),
                    a.getParameterName(i),
                    a.getParameterType(i).getType(),
                    i);
        }
        return builder.toDescriptor();
    }
View Full Code Here


        }
        if (a.getReturnType().isVoid()) {
            return null;
        }

        Builder builder = new Builder(MockOperator.class, context);
        builder.addInput(
                a.getParameterDocument(0),
                "in",
                a.getParameterType(0).getType(),
                0);

        builder.addParameter(
                a.getParameterDocument(1),
                "param",
                a.getParameterType(1).getType(),
                1);

        builder.addOutput(
                a.getReturnDocument(),
                "out",
                a.getReturnType().getType(),
                null,
                null);

        return builder.toDescriptor();
    }
View Full Code Here

        });
        if (a.hasError()) {
            return null;
        }

        Builder builder = new Builder(getTargetAnnotationType(), context);
        builder.addAttribute(FlowBoundary.SHUFFLE);
        builder.addAttribute(a.getObservationCount());
        if (selector != null) {
            builder.addOperatorHelper(selector);
        }
        builder.setDocumentation(a.getExecutableDocument());
        builder.addInput(
                a.getParameterDocument(0),
                a.getParameterName(0),
                a.getParameterType(0).getType(),
                0,
                masterKey);
        builder.addInput(
                a.getParameterDocument(1),
                a.getParameterName(1),
                a.getParameterType(1).getType(),
                1,
                transactionKey);
        builder.addOutput(
                a.getReturnDocument(),
                annotation.joinedPort(),
                a.getReturnType().getType(),
                null,
                null);
        builder.addOutput(
                "結合に失敗したデータ",
                annotation.missedPort(),
                a.getParameterType(1).getType(),
                a.getParameterName(1),
                null);
        return builder.toDescriptor();
    }
View Full Code Here

        }
        if (a.hasError()) {
            return null;
        }

        Builder builder = new Builder(getTargetAnnotationType(), context);
        builder.addAttribute(a.getObservationCount());
        builder.setDocumentation(a.getExecutableDocument());
        builder.addInput(
                a.getParameterDocument(0),
                a.getParameterName(0),
                a.getParameterType(0).getType(),
                0);

        for (VariableElement var : constants) {
            builder.addOutput(
                    a.getDocument(var),
                    JavaName.of(var.getSimpleName().toString()).toMemberName(),
                    a.getParameterType(0).getType(),
                    a.getParameterName(0),
                    null);
        }
        for (int i = 1, n = a.countParameters(); i < n; i++) {
            builder.addParameter(
                    a.getParameterDocument(i),
                    a.getParameterName(i),
                    a.getParameterType(i).getType(),
                    i);
        }
        return builder.toDescriptor();
    }
View Full Code Here

        }
        if (a.hasError()) {
            return null;
        }

        Builder builder = new Builder(Extract.class, context);
        builder.addAttribute(a.getObservationCount());
        builder.setDocumentation(a.getExecutableDocument());
        builder.addInput(
                a.getParameterDocument(0),
                a.getParameterName(0),
                a.getParameterType(0).getType(),
                0);
        for (int i = 1; i < startParameters; i++) {
            TypeConstraint outputType = a.getParameterType(i).getTypeArgument();
            TypeMirror outputTypeMirror = outputType.getType();
            String found = builder.findInput(outputTypeMirror);
            if (found == null && outputType.isProjectiveModel()) {
                a.error("出力型{0}に対する入力が見つかりません", outputTypeMirror);
            }
            builder.addOutput(
                    a.getParameterDocument(i),
                    a.getParameterName(i),
                    outputTypeMirror,
                    found,
                    i);
        }
        for (int i = startParameters, n = a.countParameters(); i < n; i++) {
            builder.addParameter(
                    a.getParameterDocument(i),
                    a.getParameterName(i),
                    a.getParameterType(i).getType(),
                    i);
        }
        return builder.toDescriptor();
    }
View Full Code Here

        List<DocElement> elements = Lists.create();
        elements.addAll(a.getExecutableDocument());
        elements.add(context.environment.getFactory().newDocText(
                "<p>なお、この演算子の出力は結線しなくても自動的に停止演算子に結線される。</p>"));

        Builder builder = new Builder(getTargetAnnotationType(), context);
        builder.addAttribute(a.getObservationCount(ObservationCount.AT_LEAST_ONCE));
        builder.addAttribute(Connectivity.OPTIONAL);
        builder.addAttribute(annotation.value());
        builder.setDocumentation(elements);
        builder.addInput(
                a.getParameterDocument(0),
                a.getParameterName(0),
                a.getParameterType(0).getType(),
                0);
        builder.addOutput(
                "入力された内容",
                annotation.outputPort(),
                a.getParameterType(0).getType(),
                a.getParameterName(0),
                0);
        for (int i = 1, n = a.countParameters(); i < n; i++) {
            builder.addParameter(
                    a.getParameterDocument(i),
                    a.getParameterName(i),
                    a.getParameterType(i).getType(),
                    i);
        }
        return builder.toDescriptor();
    }
View Full Code Here

            a.error("注釈の解釈に失敗しました");
            return null;
        }

        // redirect to @CoGroup
        Builder builder = new Builder(CoGroup.class, context);
        builder.addAttribute(FlowBoundary.SHUFFLE);
        builder.addAttribute(a.getObservationCount());
        builder.addAttribute(annotation.inputBuffer());
        builder.setDocumentation(a.getExecutableDocument());
        builder.addInput(
                a.getParameterDocument(0),
                a.getParameterName(0),
                a.getParameterType(0).getTypeArgument().getType(),
                0,
                key);
        for (int i = 1; i < startParameters; i++) {
            TypeConstraint outputType = a.getParameterType(i).getTypeArgument();
            TypeMirror outputTypeMirror = outputType.getType();
            String found = builder.findInput(outputTypeMirror);
            if (found == null && outputType.isProjectiveModel()) {
                a.error("出力型{0}に対する入力が見つかりません", outputTypeMirror);
            }
            builder.addOutput(
                    a.getParameterDocument(i),
                    a.getParameterName(i),
                    outputTypeMirror,
                    found,
                    i);
        }
        for (int i = startParameters, n = a.countParameters(); i < n; i++) {
            builder.addParameter(
                    a.getParameterDocument(i),
                    a.getParameterName(i),
                    a.getParameterType(i).getType(),
                    i);
        }
        return builder.toDescriptor();
    }
View Full Code Here

        });
        if (a.hasError()) {
            return null;
        }

        Builder builder = new Builder(getTargetAnnotationType(), context);
        builder.addAttribute(FlowBoundary.SHUFFLE);
        builder.addAttribute(a.getObservationCount());
        if (selector != null) {
            builder.addOperatorHelper(selector);
        }
        builder.setDocumentation(a.getExecutableDocument());
        builder.addInput(
                a.getParameterDocument(0),
                a.getParameterName(0),
                a.getParameterType(0).getType(),
                0,
                masterKey);
        builder.addInput(
                a.getParameterDocument(1),
                a.getParameterName(1),
                a.getParameterType(1).getType(),
                1,
                transactionKey);
        builder.addOutput(
                a.getParameterName(0) + "の引き当てに成功した" + a.getParameterName(1),
                annotation.foundPort(),
                a.getParameterType(1).getType(),
                a.getParameterName(1),
                null);
        builder.addOutput(
                a.getParameterName(0) + "の引き当てに失敗した" + a.getParameterName(1),
                annotation.missedPort(),
                a.getParameterType(1).getType(),
                a.getParameterName(1),
                null);
        return builder.toDescriptor();
    }
View Full Code Here

        });
        if (a.hasError()) {
            return null;
        }

        Builder builder = new Builder(getTargetAnnotationType(), context);
        builder.addAttribute(a.getObservationCount());
        builder.addAttribute(FlowBoundary.SHUFFLE);
        if (selector != null) {
            builder.addOperatorHelper(selector);
        }
        builder.setDocumentation(a.getExecutableDocument());
        builder.addInput(
                a.getParameterDocument(0),
                a.getParameterName(0),
                a.getParameterType(0).getType(),
                0,
                masterKey);
        builder.addInput(
                a.getParameterDocument(1),
                a.getParameterName(1),
                a.getParameterType(1).getType(),
                1,
                transactionKey);
        builder.addOutput(
                "引き当ておよび更新が成功したデータ",
                annotation.updatedPort(),
                a.getParameterType(1).getType(),
                a.getParameterName(1),
                null);
        builder.addOutput(
                "引き当てに失敗したデータ",
                annotation.missedPort(),
                a.getParameterType(1).getType(),
                a.getParameterName(1),
                null);
        for (int i = 2, n = a.countParameters(); i < n; i++) {
            builder.addParameter(
                    a.getParameterDocument(i),
                    a.getParameterName(i),
                    a.getParameterType(i).getType(),
                    i);
        }
        return builder.toDescriptor();
    }
View Full Code Here

        });
        if (a.hasError()) {
            return null;
        }

        Builder builder = new Builder(getTargetAnnotationType(), context);
        builder.addAttribute(FlowBoundary.SHUFFLE);
        builder.addAttribute(a.getObservationCount());
        builder.addAttribute(annotation.partialAggregation());
        builder.setDocumentation(a.getExecutableDocument());
        builder.addInput(
                a.getParameterDocument(1),
                Fold.INPUT,
                a.getParameterType(1).getType(),
                1,
                foldKey);
        builder.addOutput(
                "畳み込みの結果",
                annotation.outputPort(),
                a.getParameterType(0).getType(),
                Fold.INPUT,
                0);
        for (int i = 2, n = a.countParameters(); i < n; i++) {
            builder.addParameter(
                    a.getParameterDocument(i),
                    a.getParameterName(i),
                    a.getParameterType(i).getType(),
                    i);
        }
        return builder.toDescriptor();
    }
View Full Code Here

TOP

Related Classes of com.asakusafw.compiler.operator.OperatorMethodDescriptor.Builder

Copyright © 2018 www.massapicom. 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.