]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/types/kinds/KCon.java
Migrated source code from Simantics SVN
[simantics/platform.git] / bundles / org.simantics.scl.compiler / src / org / simantics / scl / compiler / types / kinds / KCon.java
diff --git a/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/types/kinds/KCon.java b/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/types/kinds/KCon.java
new file mode 100644 (file)
index 0000000..73ac011
--- /dev/null
@@ -0,0 +1,32 @@
+package org.simantics.scl.compiler.types.kinds;
+
+import org.simantics.scl.compiler.types.util.TypeUnparsingContext;
+
+/**
+ * This class represent a type kind constant with a given name.
+ * 
+ * The {@link #contains(KMetaVar)} method always returns false, as kind constants do not
+ * include any meta-variable-references.
+ */
+public class KCon extends Kind {
+    public final String name;
+
+    KCon(String name) {
+        this.name = name;
+    }
+
+    @Override
+    public String toString() {
+        return name;
+    }
+    
+    @Override
+    protected void toStringPar(TypeUnparsingContext tuc, StringBuilder b) {
+        b.append(name);
+    }
+
+    @Override
+    public boolean contains(KMetaVar var) {
+        return false;
+    }    
+}