diff options
author | 2021-08-09 03:10:14 +0200 | |
---|---|---|
committer | 2021-08-09 03:10:14 +0200 | |
commit | 06db1751c016246ad37bf38f875db8f3b64920f7 (patch) | |
tree | 220287f9330521a3e8b4e9e53e79b354c69f82ab | |
parent | Tuple and Tuple continuous hash provider (diff) | |
download | refinery-06db1751c016246ad37bf38f875db8f3b64920f7.tar.gz refinery-06db1751c016246ad37bf38f875db8f3b64920f7.tar.zst refinery-06db1751c016246ad37bf38f875db8f3b64920f7.zip |
Symbols
5 files changed, 57 insertions, 0 deletions
diff --git a/model-data/src/main/java/org/eclipse/viatra/solver/data/model/symbols/IntegerSymbol.java b/model-data/src/main/java/org/eclipse/viatra/solver/data/model/symbols/IntegerSymbol.java new file mode 100644 index 00000000..b5e0a326 --- /dev/null +++ b/model-data/src/main/java/org/eclipse/viatra/solver/data/model/symbols/IntegerSymbol.java | |||
@@ -0,0 +1,8 @@ | |||
1 | package org.eclipse.viatra.solver.data.model.symbols; | ||
2 | |||
3 | public class IntegerSymbol extends Symbol{ | ||
4 | |||
5 | public IntegerSymbol(String name, int arity) { | ||
6 | super(name, arity); | ||
7 | } | ||
8 | } | ||
diff --git a/model-data/src/main/java/org/eclipse/viatra/solver/data/model/symbols/PredicateSymbol.java b/model-data/src/main/java/org/eclipse/viatra/solver/data/model/symbols/PredicateSymbol.java new file mode 100644 index 00000000..84e6aff6 --- /dev/null +++ b/model-data/src/main/java/org/eclipse/viatra/solver/data/model/symbols/PredicateSymbol.java | |||
@@ -0,0 +1,9 @@ | |||
1 | package org.eclipse.viatra.solver.data.model.symbols; | ||
2 | |||
3 | public class PredicateSymbol extends Symbol{ | ||
4 | |||
5 | public PredicateSymbol(String name, int arity) { | ||
6 | super(name, arity); | ||
7 | } | ||
8 | |||
9 | } | ||
diff --git a/model-data/src/main/java/org/eclipse/viatra/solver/data/model/symbols/RealSymbol.java b/model-data/src/main/java/org/eclipse/viatra/solver/data/model/symbols/RealSymbol.java new file mode 100644 index 00000000..081d2196 --- /dev/null +++ b/model-data/src/main/java/org/eclipse/viatra/solver/data/model/symbols/RealSymbol.java | |||
@@ -0,0 +1,8 @@ | |||
1 | package org.eclipse.viatra.solver.data.model.symbols; | ||
2 | |||
3 | public class RealSymbol extends Symbol{ | ||
4 | |||
5 | public RealSymbol(String name, int arity) { | ||
6 | super(name, arity); | ||
7 | } | ||
8 | } | ||
diff --git a/model-data/src/main/java/org/eclipse/viatra/solver/data/model/symbols/Symbol.java b/model-data/src/main/java/org/eclipse/viatra/solver/data/model/symbols/Symbol.java new file mode 100644 index 00000000..6a02cd2d --- /dev/null +++ b/model-data/src/main/java/org/eclipse/viatra/solver/data/model/symbols/Symbol.java | |||
@@ -0,0 +1,22 @@ | |||
1 | package org.eclipse.viatra.solver.data.model.symbols; | ||
2 | |||
3 | import java.util.Comparator; | ||
4 | |||
5 | public class Symbol { | ||
6 | public static final Comparator<Symbol> symbolComparator = (o1, o2) -> o1.getName().compareTo(o2.getName()); | ||
7 | private final String name; | ||
8 | private final int arity; | ||
9 | |||
10 | public Symbol(String name, int arity) { | ||
11 | super(); | ||
12 | this.name = name; | ||
13 | this.arity = arity; | ||
14 | } | ||
15 | |||
16 | public String getName() { | ||
17 | return name; | ||
18 | } | ||
19 | public int getArity() { | ||
20 | return arity; | ||
21 | } | ||
22 | } | ||
diff --git a/model-data/src/main/java/org/eclipse/viatra/solver/data/model/symbols/SymbolComparator.java b/model-data/src/main/java/org/eclipse/viatra/solver/data/model/symbols/SymbolComparator.java new file mode 100644 index 00000000..ab7834f1 --- /dev/null +++ b/model-data/src/main/java/org/eclipse/viatra/solver/data/model/symbols/SymbolComparator.java | |||
@@ -0,0 +1,10 @@ | |||
1 | package org.eclipse.viatra.solver.data.model.symbols; | ||
2 | |||
3 | import java.util.Comparator; | ||
4 | |||
5 | public class SymbolComparator implements Comparator<Symbol>{ | ||
6 | @Override | ||
7 | public int compare(Symbol o1, Symbol o2) { | ||
8 | return o1.getName().compareTo(o2.getName()); | ||
9 | } | ||
10 | } | ||