diff options
Diffstat (limited to 'subprojects/store')
-rw-r--r-- | subprojects/store/src/main/java/tools/refinery/store/representation/cardinality/NonEmptyCardinalityInterval.java | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/subprojects/store/src/main/java/tools/refinery/store/representation/cardinality/NonEmptyCardinalityInterval.java b/subprojects/store/src/main/java/tools/refinery/store/representation/cardinality/NonEmptyCardinalityInterval.java index 2e7780da..bfaeea25 100644 --- a/subprojects/store/src/main/java/tools/refinery/store/representation/cardinality/NonEmptyCardinalityInterval.java +++ b/subprojects/store/src/main/java/tools/refinery/store/representation/cardinality/NonEmptyCardinalityInterval.java | |||
@@ -83,7 +83,10 @@ public record NonEmptyCardinalityInterval(int lowerBound, UpperCardinality upper | |||
83 | 83 | ||
84 | @Override | 84 | @Override |
85 | public String toString() { | 85 | public String toString() { |
86 | var closeBracket = upperBound instanceof UnboundedUpperCardinality ? ")" : "]"; | 86 | if (upperBound instanceof FiniteUpperCardinality finiteUpperCardinality && |
87 | return "[%d..%s%s".formatted(lowerBound, upperBound, closeBracket); | 87 | finiteUpperCardinality.finiteUpperBound() == lowerBound) { |
88 | return "[%d]".formatted(lowerBound); | ||
89 | } | ||
90 | return "[%d..%s]".formatted(lowerBound, upperBound); | ||
88 | } | 91 | } |
89 | } | 92 | } |