blob: ea56653a0461aa5e0c8341a10845513f2422d489 (
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
|
/*
* SPDX-FileCopyrightText: 2023 The Refinery Authors <https://refinery.tools/>
*
* SPDX-License-Identifier: EPL-2.0
*/
package tools.refinery.store.dse.propagation;
public enum PropagationResult {
UNCHANGED,
PROPAGATED,
REJECTED;
public PropagationResult andThen(PropagationResult next) {
return switch (this) {
case UNCHANGED -> next;
case PROPAGATED -> next == REJECTED ? REJECTED : PROPAGATED;
case REJECTED -> REJECTED;
};
}
public boolean isRejected() {
return this == REJECTED;
}
public boolean isChanged() {
return this == PROPAGATED;
}
}
|