2017-03-03 19:10:02 +01:00
|
|
|
package org.gcube.dataanalysis.dataminer.poolmanager.datamodel;
|
|
|
|
|
|
|
|
import java.util.Collection;
|
2017-05-17 18:16:25 +02:00
|
|
|
import java.util.HashSet;
|
|
|
|
import java.util.Set;
|
2017-03-03 19:10:02 +01:00
|
|
|
import java.util.Vector;
|
|
|
|
|
|
|
|
|
2017-04-03 14:35:03 +02:00
|
|
|
public class Algorithm {
|
2017-03-29 16:06:46 +02:00
|
|
|
|
|
|
|
|
2017-04-03 14:35:03 +02:00
|
|
|
|
2017-03-29 16:06:46 +02:00
|
|
|
|
2017-03-03 19:10:02 +01:00
|
|
|
private String name;
|
|
|
|
|
|
|
|
private String description;
|
|
|
|
|
|
|
|
private String clazz;
|
|
|
|
|
2017-05-12 17:32:14 +02:00
|
|
|
private String category;
|
|
|
|
|
2017-03-03 19:10:02 +01:00
|
|
|
private String algorithmType;
|
|
|
|
|
|
|
|
private String skipJava;
|
|
|
|
|
|
|
|
private String packageURL;
|
|
|
|
|
|
|
|
private Collection<Action> actions;
|
|
|
|
|
|
|
|
private Collection<Dependency> dependencies;
|
|
|
|
|
|
|
|
public Algorithm() {
|
|
|
|
this.actions = new Vector<>();
|
|
|
|
this.dependencies = new Vector<>();
|
|
|
|
Dependency p = new Dependency();
|
2017-05-12 17:32:14 +02:00
|
|
|
|
|
|
|
***REMOVED***init with default values
|
|
|
|
this.skipJava = "N";
|
|
|
|
this.algorithmType = "transducerers";
|
2017-03-03 19:10:02 +01:00
|
|
|
***REMOVED***
|
|
|
|
|
|
|
|
public void addDependency(Dependency dep) {
|
|
|
|
this.dependencies.add(dep);
|
|
|
|
***REMOVED***
|
|
|
|
|
|
|
|
public void addAction(Action action) {
|
|
|
|
this.actions.add(action);
|
|
|
|
***REMOVED***
|
|
|
|
|
|
|
|
public String getName() {
|
|
|
|
return name;
|
|
|
|
***REMOVED***
|
|
|
|
|
|
|
|
public void setName(String name) {
|
|
|
|
this.name = name;
|
|
|
|
***REMOVED***
|
|
|
|
|
|
|
|
public String getDescription() {
|
|
|
|
return description;
|
|
|
|
***REMOVED***
|
|
|
|
|
|
|
|
public void setDescription(String description) {
|
|
|
|
this.description = description;
|
|
|
|
***REMOVED***
|
|
|
|
|
|
|
|
public String getCategory() {
|
|
|
|
return category;
|
|
|
|
***REMOVED***
|
|
|
|
|
|
|
|
public void setCategory(String category) {
|
|
|
|
this.category = category;
|
|
|
|
***REMOVED***
|
|
|
|
|
|
|
|
public Collection<Action> getActions() {
|
|
|
|
return actions;
|
|
|
|
***REMOVED***
|
|
|
|
|
|
|
|
public Collection<Dependency> getDependencies() {
|
|
|
|
return dependencies;
|
|
|
|
***REMOVED***
|
2017-05-17 18:16:25 +02:00
|
|
|
|
|
|
|
public Collection<Dependency> getOSDependencies(){
|
|
|
|
Set<Dependency> deps = new HashSet<>();
|
|
|
|
for(Dependency d: this.getDependencies()){
|
|
|
|
if(d.getType().equals("os")){
|
|
|
|
deps.add(d);
|
|
|
|
***REMOVED***
|
|
|
|
***REMOVED***
|
|
|
|
return deps;
|
|
|
|
***REMOVED***
|
|
|
|
|
|
|
|
public Collection<Dependency> getCranDependencies(){
|
|
|
|
Set<Dependency> deps = new HashSet<>();
|
|
|
|
for(Dependency d: this.getDependencies()){
|
|
|
|
if(d.getType().equals("cran")){
|
|
|
|
deps.add(d);
|
|
|
|
***REMOVED***
|
|
|
|
***REMOVED***
|
|
|
|
return deps;
|
|
|
|
***REMOVED***
|
|
|
|
|
|
|
|
public Collection<Dependency> getGitHubDependencies(){
|
|
|
|
Set<Dependency> deps = new HashSet<>();
|
|
|
|
for(Dependency d: this.getDependencies()){
|
|
|
|
if(d.getType().equals("github")){
|
|
|
|
deps.add(d);
|
|
|
|
***REMOVED***
|
|
|
|
***REMOVED***
|
|
|
|
return deps;
|
|
|
|
***REMOVED***
|
2017-03-03 19:10:02 +01:00
|
|
|
|
|
|
|
public void setDependencies(Collection<Dependency> deps) {
|
|
|
|
this.dependencies = deps;
|
|
|
|
***REMOVED***
|
|
|
|
|
|
|
|
public String toString() {
|
|
|
|
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() {
|
|
|
|
return clazz;
|
|
|
|
***REMOVED***
|
|
|
|
|
|
|
|
public void setClazz(String clazz) {
|
|
|
|
this.clazz = clazz;
|
|
|
|
***REMOVED***
|
|
|
|
|
|
|
|
public String getPackageURL() {
|
|
|
|
return packageURL;
|
|
|
|
***REMOVED***
|
|
|
|
|
|
|
|
public void setPackageURL(String packageURL) {
|
|
|
|
this.packageURL = packageURL;
|
|
|
|
***REMOVED***
|
|
|
|
|
|
|
|
public String getAlgorithmType() {
|
|
|
|
return algorithmType;
|
|
|
|
***REMOVED***
|
|
|
|
|
|
|
|
public void setAlgorithmType(String algorithmType) {
|
|
|
|
this.algorithmType = algorithmType;
|
|
|
|
***REMOVED***
|
|
|
|
|
|
|
|
public String getSkipJava() {
|
|
|
|
return skipJava;
|
|
|
|
***REMOVED***
|
|
|
|
|
|
|
|
public void setSkipJava(String skipJava) {
|
|
|
|
this.skipJava = skipJava;
|
|
|
|
***REMOVED***
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
***REMOVED***
|