it.ssc.metadata.MetaDataDatasetFMTSerializable Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jsr331-ssc Show documentation
Show all versions of jsr331-ssc Show documentation
This is a JSR331 interface for SSC (Software for the Calculation of the Simplex) is a java library for solving linear programming problems v. 3.0.1.
SSC was designed and developed by Stefano Scarioli.
The newest version!
package it.ssc.metadata;
import it.ssc.step.exception.InvalidDichiarationOptions;
import java.util.ArrayList;
import java.util.HashMap;
public class MetaDataDatasetFMTSerializable implements MetaDataDatasetFMTInterface {
private static final long serialVersionUID = 7693698462052741045L;
private ArrayList meta_field;
private HashMap properties;
public MetaDataDatasetFMTSerializable() {
this.properties=new HashMap();
this.meta_field=new ArrayList();
}
public HashMap getMapProperties() {
return properties;
}
public void setProperties(NameMetaParameters.NAME_META_PARAMETERS key,Object value) {
properties.put(key, value);
}
public void addField(FieldInterface field) {
this.meta_field.add(field);
}
public ArrayList getListField() {
return meta_field;
}
public void renameInputVarIn(String new_name,String old_name) throws InvalidDichiarationOptions {
boolean trovato=false;
for(FieldInterface field:meta_field) {
if(field.getName().equals(old_name)) {
field.renameField(new_name);
trovato=true;
}
}
if(!trovato) throw new InvalidDichiarationOptions("La variabile da rinominare "+old_name +" non esiste");
}
}