Package com.dna.jopt.io.importing.json
Class OptimizationJSONImporter
java.lang.Object
com.dna.jopt.io.importing.json.OptimizationJSONImporter
- All Implemented Interfaces:
IJOptImporter<IOptimization>,IOptimizationImporter
This provides methods in order import an
IOptimization as a JSON file.- Since:
- 04/10/2019
- Version:
- 07/10/2019
- Author:
- DNA
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionread(InputStream fis) booleanupdate(InputStream fis, IOptimization existingOpti) booleanupdate(InputStream fis, IOptimization existingOpti, boolean isIgnoreExistingSolution) Update.booleanupdate(InputStream fis, IOptimization existingOpti, Optional<INodeEdgeConnector> existingNodeConnector, Properties existingProperties, boolean isOnlyPropertyUpdate) Updates an existingIOptimizationoptionally with already existingINodeEdgeConnectorandproperties.booleanupdate(InputStream fis, IOptimization existingOpti, Optional<INodeEdgeConnector> existingNodeConnector, Properties existingProperties, boolean isOnlyPropertyUpdate, boolean isIgnoreExistingSolution) Updates an existingIOptimizationoptionally with already existingINodeEdgeConnectorandproperties.
-
Constructor Details
-
OptimizationJSONImporter
public OptimizationJSONImporter()
-
-
Method Details
-
read
- Specified by:
readin interfaceIJOptImporter<IOptimization>- Specified by:
readin interfaceIOptimizationImporter- Parameters:
fis- the inputStream- Returns:
- the optional IOptimization from the file
-
update
- Specified by:
updatein interfaceIOptimizationImporter- Parameters:
fis- the inputStreamexistingOpti- the iOptimization to be updated- Returns:
- true if the settings were accepted
-
update
public boolean update(InputStream fis, IOptimization existingOpti, boolean isIgnoreExistingSolution) Update.- Specified by:
updatein interfaceIOptimizationImporter- Parameters:
fis- the fisexistingOpti- the existing optiisIgnoreExistingSolution- the is ignore existing solution- Returns:
- true, if successful
-
update
public boolean update(InputStream fis, IOptimization existingOpti, Optional<INodeEdgeConnector> existingNodeConnector, Properties existingProperties, boolean isOnlyPropertyUpdate) Updates an existingIOptimizationoptionally with already existingINodeEdgeConnectorandproperties.If the
booleanistrue, only the givenpropertiesare being overwritten. Iffalsethe rest of theparametersare set todefault.- Specified by:
updatein interfaceIOptimizationImporter- Parameters:
fis- the InputStreamexistingOpti- the existing iOptimizationexistingNodeConnector- an existing node connectorexistingProperties- the existing propertiesisOnlyPropertyUpdate- the boolean whether the IOptimization is only to be updated and no other parameters reset- Returns:
- true if the settings were accepted
-
update
public boolean update(InputStream fis, IOptimization existingOpti, Optional<INodeEdgeConnector> existingNodeConnector, Properties existingProperties, boolean isOnlyPropertyUpdate, boolean isIgnoreExistingSolution) Updates an existingIOptimizationoptionally with already existingINodeEdgeConnectorandproperties.If the
booleanistrue, only the givenpropertiesare being overwritten. Iffalsethe rest of theparametersare set todefault.- Specified by:
updatein interfaceIOptimizationImporter- Parameters:
fis- the InputStreamexistingOpti- the existing iOptimizationexistingNodeConnector- an existing node connectorexistingProperties- the existing propertiesisOnlyPropertyUpdate- the boolean whether the IOptimization is only to be updated and no other parameters resetisIgnoreExistingSolution- the is ignore existing solution- Returns:
- true if the settings were accepted
-