diff options
Diffstat (limited to 'subprojects/store-reasoning/src/main/java/tools/refinery/store/reasoning/translator/typehierarchy/TypeInfo.java')
-rw-r--r-- | subprojects/store-reasoning/src/main/java/tools/refinery/store/reasoning/translator/typehierarchy/TypeInfo.java | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/subprojects/store-reasoning/src/main/java/tools/refinery/store/reasoning/translator/typehierarchy/TypeInfo.java b/subprojects/store-reasoning/src/main/java/tools/refinery/store/reasoning/translator/typehierarchy/TypeInfo.java index 68ed4089..e6bdaff2 100644 --- a/subprojects/store-reasoning/src/main/java/tools/refinery/store/reasoning/translator/typehierarchy/TypeInfo.java +++ b/subprojects/store-reasoning/src/main/java/tools/refinery/store/reasoning/translator/typehierarchy/TypeInfo.java | |||
@@ -9,5 +9,15 @@ import tools.refinery.store.reasoning.representation.PartialRelation; | |||
9 | 9 | ||
10 | import java.util.*; | 10 | import java.util.*; |
11 | 11 | ||
12 | public record TypeInfo(Collection<PartialRelation> supertypes, boolean abstractType) { | 12 | public record TypeInfo(Set<PartialRelation> supertypes, boolean abstractType) { |
13 | public TypeInfo(Collection<PartialRelation> supertypes, boolean abstractType) { | ||
14 | this(Set.copyOf(supertypes), abstractType); | ||
15 | } | ||
16 | |||
17 | public TypeInfo addSupertype(PartialRelation newSupertype) { | ||
18 | var newSupertypes = new ArrayList<PartialRelation>(supertypes.size() + 1); | ||
19 | newSupertypes.addAll(supertypes); | ||
20 | newSupertypes.add(newSupertype); | ||
21 | return new TypeInfo(newSupertypes, abstractType); | ||
22 | } | ||
13 | } | 23 | } |