blob: 9900390fed27407f4f122a48dff0ca399b647825 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
/*
* SPDX-FileCopyrightText: 2021-2023 The Refinery Authors <https://refinery.tools/>
*
* SPDX-License-Identifier: EPL-2.0
*/
package tools.refinery.store.dse.internal.action;
import tools.refinery.store.dse.DesignSpaceExplorationAdapter;
import tools.refinery.store.model.Model;
import tools.refinery.store.tuple.Tuple;
public class DeleteAction implements AtomicAction {
private final ActionVariable variable;
private DesignSpaceExplorationAdapter dseAdapter;
public DeleteAction(ActionVariable variable) {
this.variable = variable;
}
@Override
public void fire(Tuple activation) {
dseAdapter.deleteObject(variable.getValue());
}
@Override
public DeleteAction prepare(Model model) {
dseAdapter = model.getAdapter(DesignSpaceExplorationAdapter.class);
return this;
}
@Override
public boolean equalsWithSubstitution(AtomicAction other) {
if (other == null || getClass() != other.getClass()) {
return false;
}
var otherAction = (DeleteAction) other;
return this.variable.getClass() == otherAction.variable.getClass();
}
}
|