Commit 80f7c878 authored by Hoda Anvari Kazemabad's avatar Hoda Anvari Kazemabad
Browse files

New DataPathConfigParser

parent fe4fc081
Pipeline #101569 canceled with stages
package de.monticore.lang.monticar.cnnarch.mxnetgenerator;
import de.monticore.lang.monticar.cnntrain._symboltable.*;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class DataPathConfigParser{
private String configTargetPath;
ConfigurationSymbol configuration;
private String configFileName;
public DataPathConfigParser(ConfigurationSymbol configuration, String configPath) {
this.configuration = configuration;
setConfigPath(configPath);
setConfigFileName("ConfigChainAutomation");
}
public String getConfigFileName() {
return configFileName;
}
public void setConfigFileName(String configFileName){
this.configFileName = configFileName + ".cnnt";
}
public String getConfigPath() {
if (configTargetPath.charAt(configTargetPath.length() - 1) != '/') {
this.configTargetPath = configTargetPath + "/";
}
return configTargetPath;
}
public void setConfigPath(String configTargetPath){
this.configTargetPath = configTargetPath + getConfigFileName;
}
public ConfigurationSymbol getConfiguration() {
return configuration;
}
public String getDataPath(String modelName) {
if (!getConfiguration().getEntryMap().containsKey(modelName)) {
return null;
}
return String.valueOf(getConfiguration().getEntry(modelName).getValue());
}
}
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment