Package LONI.tree.GraphObject

Source Code of LONI.tree.GraphObject.DataModule

package LONI.tree.GraphObject;

import java.util.ArrayList;
import java.util.List;


import Core.Pair;
import Galaxy.Tree.Workflow.Step;
import LONI.tree.Authors;
import LONI.tree.LoniNode;
import LONI.tree.module.Output;
import LONI.tree.module.Parameter;
import LONI.tree.module.Values;
import LONI.tree.module.Parameter;
import LONI.tree.module.format.FileTypes;
import LONI.tree.module.format.Format;
import LONI.tree.module.metadata.Metadata;
import LONI.visitor.DFSVisitor;
import LONI.visitor.LoniToGalaxyConverter;
import Taverna.Tree.DataFlowImpl.Link;

public class DataModule extends GraphObject {
  private String name;
  private String myPackage;
  private String version;
  private String description;
  private int rotation;
  private String type;
  private boolean source;
  private boolean dirSource;
  private boolean dirDump;
  private boolean useDirSourceFilters;
  private int dirSourceFilterType;
  private boolean recursive;
  private FileTypes fileTypes;
  private Metadata metadata;
  private String uri;
  private List<String> tags;
  private List<Output> outputs;
  private List<Parameter> inputs;
  private Values values;
  private Authors authors;
 
  public DataModule() {
    this.fileTypes = new FileTypes();
    this.inputs = new ArrayList<Parameter>();
    this.outputs = new ArrayList<Output>();
    this.inputs = new ArrayList<Parameter>();
    this.tags = new ArrayList<String>();
    this.values = new Values();
    this.authors = new Authors();
  }

  public DataModule(String id, String name, String myPackage, String version,
      String description, int posX, int posY, int rotation, String type,
      boolean source, boolean dirSource, boolean dirDump,
      boolean useDirSourceFilters, int dirSourceFilterType,
      boolean recursive, Metadata metadata) {
    super(posX, posY, id);
    this.name = name;
    this.myPackage = myPackage;
    this.version = version;
    this.description = description;
    this.rotation = rotation;
    this.type = type;
    this.source = source;
    this.dirSource = dirSource;
    this.dirDump = dirDump;
    this.useDirSourceFilters = useDirSourceFilters;
    this.dirSourceFilterType = dirSourceFilterType;
    this.recursive = recursive;
    this.fileTypes = new FileTypes();
    this.metadata = metadata;
    this.inputs = new ArrayList<Parameter>();
    this.outputs = new ArrayList<Output>();
    this.values = new Values();
    this.authors = new Authors();
    this.tags = new ArrayList<String>();
    this.uri = null;
   
  }
 
  public void addInput(Parameter input){
    this.inputs.add(input);
  }
  public List<Parameter> getInputs(){
    return this.inputs;
  }
   
  public FileTypes getFileTypes() {
    return fileTypes;
  }
 
  public String getName() {
    return name;
  }
  public String getMyPackage() {
    return myPackage;
  }
  public String getVersion() {
    return version;
  }
  public String getDescription() {
    return description;
  }
  public int getRotation() {
    return rotation;
  }
  public String getType() {
    return type;
  }
  public boolean isSource() {
    return source;
  }
  public boolean isDirSource() {
    return dirSource;
  }
  public boolean isDirDump() {
    return dirDump;
  }
  public boolean isUseDirSourceFilters() {
    return useDirSourceFilters;
  }
  public int getDirSourceFilterType() {
    return dirSourceFilterType;
  }
  public boolean isRecursive() {
    return recursive;
  }
  public Metadata getMetadata() {
    return metadata;
  }
  public Values getValues(){
    return values;
  }
  public Authors getAuthors(){
    return authors;
  }
  public List<String> getTags(){
    return tags;
  }
  public String getURI(){
    return uri;
  }
 
  public Link getSink(String port){
    return new Link("dataflow", null, getId());
  }
 
  public Link getSource(String port){
    return new Link("dataflow", null, getId());
  }

  public void setName(String name) {
    this.name = name;
  }

  public void setMyPackage(String myPackage) {
    this.myPackage = myPackage;
  }

  public void setVersion(String version) {
    this.version = version;
  }

  public void setDescription(String description) {
    this.description = description;
  }

  public void setRotation(int rotation) {
    this.rotation = rotation;
  }

  public void setType(String type) {
    this.type = type;
  }

  public void setSource(boolean source) {
    this.source = source;
  }

  public void setDirSource(boolean dirSource) {
    this.dirSource = dirSource;
  }

  public void setDirDump(boolean dirDump) {
    this.dirDump = dirDump;
  }

  public void setUseDirSourceFilters(boolean useDirSourceFilters) {
    this.useDirSourceFilters = useDirSourceFilters;
  }

  public void setDirSourceFilterType(int dirSourceFilterType) {
    this.dirSourceFilterType = dirSourceFilterType;
  }

  public void setRecursive(boolean recursive) {
    this.recursive = recursive;
  }

  public void setFileTypes(FileTypes fileTypes) {
    this.fileTypes = fileTypes;
  }

  public void setMetadata(Metadata metadata) {
    this.metadata = metadata;
  }

  public void setOutputs(List<Output> outputs) {
    this.outputs = outputs;
  }

  public void setInputs(List<Parameter> inputs) {
    this.inputs = inputs;
  }

  public void setValues(Values values) {
    this.values = values;
  }
 
  public void setAuthors(Authors authors){
    this.authors = authors;
  }
  public void addTag(String tag){
    tags.add(tag);
  }
  public void setURI(String uri){
    this.uri = uri;
  }
 
  @Override
  public <W,U,V> Pair<W,U> accept(DFSVisitor<U,V>.ModuleVisitor<W> caller, V o) {
    // TODO Auto-generated method stub
    return caller.visit(this, o);
  }
  public Object accept(DFSVisitor.ModuleVisitor caller) {
    // TODO Auto-generated method stub
    return caller.visit(this);
  }
  public List<Output> getOutputs() {
    // TODO Auto-generated method stub
    return this.outputs;
  }
    public void addOutput(Output output){
        this.outputs.add(output);
    }
    public DataModule copy(){
      DataModule dataModule = new DataModule();
      if(name != null) dataModule.name = new String(name);
      if(myPackage != null) dataModule.myPackage = new String(myPackage);
      if(version != null) dataModule.version = new String(version);
      if(description != null) dataModule.description = new String(description);
      dataModule.rotation = rotation;
      if(type != null) dataModule.type = new String(type);
      dataModule.source = source;
      dataModule.dirSource = dirSource;
      dataModule.dirDump = dirDump;
      dataModule.useDirSourceFilters = useDirSourceFilters;
      dataModule.dirSourceFilterType = dirSourceFilterType;
      dataModule.recursive= recursive;
      if(fileTypes != null) dataModule.fileTypes = fileTypes.copy();
      if(metadata != null) dataModule.metadata = metadata.copy();
      if(uri != null) dataModule.uri = new String(uri);
      if(tags != null){
          for(String tag : tags){
              dataModule.tags.add(tag);
          }
      }
      if(outputs !=null){
          for(Output output : outputs){
                dataModule.outputs.add(output);     

          }
      }
      if(inputs !=null){
          for(Parameter input : inputs){
                dataModule.inputs.add(input);     

          }
      }
      if(values != null) dataModule.values = values.copy();
      if(authors != null) dataModule.authors = authors.copy();
      return dataModule;
    }

}
TOP

Related Classes of LONI.tree.GraphObject.DataModule

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.