private void cleanScenarios(FactMapping toRemove) { scenarios.forEach(e -> e.removeFactMappingValueByIdentifiers(toRemove.getFactIdentifier(), toRemove.getExpressionIdentifier())); } }
private void cleanScenarios(FactMapping toRemove) { scenarios.forEach(e -> e.removeFactMappingValueByIdentifiers(toRemove.getFactIdentifier(), toRemove.getExpressionIdentifier())); } }
@Override public Range deleteCell(int rowIndex, int columnIndex) { FactMapping factMapping = simulation.getSimulationDescriptor().getFactMappingByIndex(columnIndex); simulation.getScenarioByIndex(rowIndex) .removeFactMappingValueByIdentifiers(factMapping.getFactIdentifier(), factMapping.getExpressionIdentifier()); return super.deleteCell(rowIndex, columnIndex); }
@Test public void removeFactMappingValueByIdentifiersTest() { scenario.addMappingValue(factIdentifier, expressionIdentifier, "test value"); Optional<FactMappingValue> retrieved = scenario.getFactMappingValue(factIdentifier, expressionIdentifier); assertTrue(retrieved.isPresent()); scenario.removeFactMappingValueByIdentifiers(factIdentifier, expressionIdentifier); retrieved = scenario.getFactMappingValue(factIdentifier, expressionIdentifier); assertFalse(retrieved.isPresent()); }
@Test public void removeFactMappingValueByIdentifiersTest() { scenario.addMappingValue(factIdentifier, expressionIdentifier, "test value"); Optional<FactMappingValue> retrieved = scenario.getFactMappingValue(factIdentifier, expressionIdentifier); assertTrue(retrieved.isPresent()); scenario.removeFactMappingValueByIdentifiers(factIdentifier, expressionIdentifier); retrieved = scenario.getFactMappingValue(factIdentifier, expressionIdentifier); assertFalse(retrieved.isPresent()); }