fr.insee.vtl.prov.prov.Program Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of vtl-prov Show documentation
Show all versions of vtl-prov Show documentation
Provenance static analysis
package fr.insee.vtl.prov.prov;
import java.util.HashSet;
import java.util.Set;
/* Filled thanks to listener, except for dataframInstances */
public class Program {
String id;
String label;
Set programSteps = new HashSet<>();
/* Provided running preview mode */
Set dataframeInstances = new HashSet<>();
String sourceCode;
public Program() {
}
public Program(String id, String label) {
this.id = id;
this.label = label;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getLabel() {
return label;
}
public void setLabel(String label) {
this.label = label;
}
public Set getProgramSteps() {
return programSteps;
}
public void setProgramSteps(Set programSteps) {
this.programSteps = programSteps;
}
public Set getDataframeInstances() {
return dataframeInstances;
}
public void setDataframeInstances(Set dataframeInstances) {
this.dataframeInstances = dataframeInstances;
}
public String getSourceCode() {
return sourceCode;
}
public void setSourceCode(String sourceCode) {
this.sourceCode = sourceCode;
}
public ProgramStep getProgramStepByLabel(String label) {
return programSteps.stream()
.filter(p -> p.getLabel().equals(label))
.findFirst()
.orElse(null);
}
public ProgramStep getProgramStepByIndex(int index) {
return programSteps.stream()
.filter(p -> p.getIndex() == index)
.findFirst()
.orElse(null);
}
}