dataminer-pool-manager/src/main/java/org/gcube/dataanalysis/dataminer/poolmanager/datamodel/Algorithm.java

189 lines
4.7 KiB
Java
Executable File

package org.gcube.dataanalysis.dataminer.poolmanager.datamodel;
import java.util.Collection;
import java.util.HashSet;
***REMOVED***
import java.util.Vector;
public class Algorithm ***REMOVED***
private String username;
private String fullname;
private String email;
private String language;
private String name;
private String description;
private String clazz;
private String category;
private String algorithmType;
private String skipJava;
private String packageURL;
private Collection<Action> actions;
private Collection<Dependency> dependencies;
public Algorithm() ***REMOVED***
this.actions = new Vector<>();
this.dependencies = new Vector<>();
***REMOVED*** Dependency p = new Dependency();
***REMOVED***init with default values
this.skipJava = "N";
this.algorithmType = "transducerers";
***REMOVED***
public void addDependency(Dependency dep) ***REMOVED***
this.dependencies.add(dep);
***REMOVED***
public void addAction(Action action) ***REMOVED***
this.actions.add(action);
***REMOVED***
public String getName() ***REMOVED***
return name;
***REMOVED***
public void setName(String name) ***REMOVED***
this.name = name;
***REMOVED***
public String getDescription() ***REMOVED***
return description;
***REMOVED***
public void setDescription(String description) ***REMOVED***
this.description = description.replace(": ", " ");
***REMOVED***
public String getCategory() ***REMOVED***
return category;
***REMOVED***
public void setCategory(String category) ***REMOVED***
this.category = category;
***REMOVED***
public Collection<Action> getActions() ***REMOVED***
return actions;
***REMOVED***
public Collection<Dependency> getDependencies() ***REMOVED***
return dependencies;
***REMOVED***
public Collection<Dependency> getOSDependencies()***REMOVED***
Set<Dependency> deps = new HashSet<>();
for(Dependency d: this.getDependencies())***REMOVED***
if(d.getType().equals("os"))***REMOVED***
deps.add(d);
***REMOVED***
***REMOVED***
return deps;
***REMOVED***
public Collection<Dependency> getCranDependencies()***REMOVED***
Set<Dependency> deps = new HashSet<>();
for(Dependency d: this.getDependencies())***REMOVED***
if(d.getType().equals("cran"))***REMOVED***
deps.add(d);
***REMOVED***
***REMOVED***
return deps;
***REMOVED***
public Collection<Dependency> getGitHubDependencies()***REMOVED***
Set<Dependency> deps = new HashSet<>();
for(Dependency d: this.getDependencies())***REMOVED***
if(d.getType().equals("github"))***REMOVED***
deps.add(d);
***REMOVED***
***REMOVED***
return deps;
***REMOVED***
public void setDependencies(Collection<Dependency> deps) ***REMOVED***
this.dependencies = deps;
***REMOVED***
public String toString() ***REMOVED***
String out = "Algorithm: " + this.getName()+"\n";
out+=" Class Name: " + this.getClazz()+"\n";
out+=" Description: " + this.getDescription()+"\n";
out+=" Dependencies: " + this.getDependencies()+"\n";
return out;
***REMOVED***
public String getClazz() ***REMOVED***
return clazz;
***REMOVED***
public void setClazz(String clazz) ***REMOVED***
this.clazz = clazz;
***REMOVED***
public String getPackageURL() ***REMOVED***
return packageURL;
***REMOVED***
public void setPackageURL(String packageURL) ***REMOVED***
this.packageURL = packageURL;
***REMOVED***
public String getAlgorithmType() ***REMOVED***
return algorithmType;
***REMOVED***
public void setAlgorithmType(String algorithmType) ***REMOVED***
this.algorithmType = algorithmType;
***REMOVED***
public String getSkipJava() ***REMOVED***
return skipJava;
***REMOVED***
public void setSkipJava(String skipJava) ***REMOVED***
this.skipJava = skipJava;
***REMOVED***
public String getUsername() ***REMOVED***
return username;
***REMOVED***
public void setUsername(String username) ***REMOVED***
this.username = username;
***REMOVED***
public String getFullname() ***REMOVED***
return fullname;
***REMOVED***
public void setFullname(String fullname) ***REMOVED***
this.fullname = fullname;
***REMOVED***
public String getEmail() ***REMOVED***
return email;
***REMOVED***
public void setEmail(String email) ***REMOVED***
this.email = email;
***REMOVED***
public String getLanguage() ***REMOVED***
return language;
***REMOVED***
public void setLanguage(String language) ***REMOVED***
this.language = language;
***REMOVED***
public void setActions(Collection<Action> actions) ***REMOVED***
this.actions = actions;
***REMOVED***
***REMOVED***