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

57 lines
980 B
Java
Raw Normal View History

package org.gcube.dataanalysis.dataminer.poolmanager.datamodel;
import java.util.Collection;
import java.util.Vector;
2023-01-18 17:56:48 +01:00
public class AlgorithmSet {
private String name;
private Collection<Algorithm> algorithms;
public AlgorithmSet()
2023-01-18 17:56:48 +01:00
{
this.algorithms = new Vector<>();
2023-01-18 17:56:48 +01:00
}
public String getName()
2023-01-18 17:56:48 +01:00
{
return name;
2023-01-18 17:56:48 +01:00
}
public void setName(String name)
2023-01-18 17:56:48 +01:00
{
this.name = name;
2023-01-18 17:56:48 +01:00
}
public Collection<Algorithm> getAlgorithms()
2023-01-18 17:56:48 +01:00
{
return new Vector<>(algorithms);
2023-01-18 17:56:48 +01:00
}
public void addAlgorithm(Algorithm algoritm)
2023-01-18 17:56:48 +01:00
{
this.algorithms.add(algoritm);
2023-01-18 17:56:48 +01:00
}
public Boolean hasAlgorithm(Algorithm algorithm)
2023-01-18 17:56:48 +01:00
{
for (Algorithm a : this.algorithms) {
if (a.getName().equals(algorithm.getName()))
2023-01-18 17:56:48 +01:00
{
return true;
2023-01-18 17:56:48 +01:00
}
}
return false;
2023-01-18 17:56:48 +01:00
}
public String toString()
2023-01-18 17:56:48 +01:00
{
String out = "ALGOSET: " + this.name + "\n";
2023-01-18 17:56:48 +01:00
for(Algorithm a:this.algorithms) {
out+=a+"\n";
2023-01-18 17:56:48 +01:00
}
return out;
2023-01-18 17:56:48 +01:00
}
2023-01-18 17:56:48 +01:00
}