Package javaflow.network.definer

Source Code of javaflow.network.definer.ClassComponentDef

package javaflow.network.definer;

import javaflow.components.api.Component;
import javaflow.network.api.ClassComponentDefinition;
import javaflow.network.api.ComponentDefinitionVisitor;
import javaflow.network.api.PortReference;

final class ClassComponentDef extends ComponentDef implements ClassComponentDefinition{

    private final Class<? extends Component> componentClass;

    public ClassComponentDef(String componentName, Class<? extends Component> componentClass) {
        super(componentName);
        this.componentClass = componentClass;
    }

    public PortReference port(String portName) {
        return new PortReference(name(), portName);
    }


    @Override
    public void accept(ComponentDefinitionVisitor visitor) {
        visitor.visit(this);
    }

    public Class<? extends Component> componentClass() {
        return componentClass;
    }

    public PortReference port(String portName, int i) {
        return new PortReference(name(), portName, i);
    }
}
TOP

Related Classes of javaflow.network.definer.ClassComponentDef

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.