package org.gcube.dataanalysis.dataminer.poolmanager.datamodel; import java.util.Collection; import java.util.HashSet; import java.util.Set; import java.util.Vector; public class Algorithm { 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 actions; private Collection dependencies; public Algorithm() { 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) { 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.replace(": ", " "); ***REMOVED*** public String getCategory() { return category; ***REMOVED*** public void setCategory(String category) { this.category = category; ***REMOVED*** public Collection getActions() { return actions; ***REMOVED*** public Collection getDependencies() { return dependencies; ***REMOVED*** public Collection getOSDependencies(){ Set deps = new HashSet<>(); for(Dependency d: this.getDependencies()){ if(d.getType().equals("os")){ deps.add(d); ***REMOVED*** ***REMOVED*** return deps; ***REMOVED*** public Collection getCranDependencies(){ Set deps = new HashSet<>(); for(Dependency d: this.getDependencies()){ if(d.getType().equals("cran")){ deps.add(d); ***REMOVED*** ***REMOVED*** return deps; ***REMOVED*** public Collection getGitHubDependencies(){ Set deps = new HashSet<>(); for(Dependency d: this.getDependencies()){ if(d.getType().equals("github")){ deps.add(d); ***REMOVED*** ***REMOVED*** return deps; ***REMOVED*** public void setDependencies(Collection 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*** public String getUsername() { return username; ***REMOVED*** public void setUsername(String username) { this.username = username; ***REMOVED*** public String getFullname() { return fullname; ***REMOVED*** public void setFullname(String fullname) { this.fullname = fullname; ***REMOVED*** public String getEmail() { return email; ***REMOVED*** public void setEmail(String email) { this.email = email; ***REMOVED*** public String getLanguage() { return language; ***REMOVED*** public void setLanguage(String language) { this.language = language; ***REMOVED*** public void setActions(Collection actions) { this.actions = actions; ***REMOVED*** ***REMOVED***