summaryrefslogtreecommitdiff
path: root/heat/TypeBundle.java
diff options
context:
space:
mode:
Diffstat (limited to 'heat/TypeBundle.java')
-rw-r--r--heat/TypeBundle.java33
1 files changed, 22 insertions, 11 deletions
diff --git a/heat/TypeBundle.java b/heat/TypeBundle.java
index d5f8121..44e3749 100644
--- a/heat/TypeBundle.java
+++ b/heat/TypeBundle.java
@@ -18,24 +18,35 @@ class TypeBundle {
}
@Override public String toString() {
- return String.format("%s (%s)",
- type,
- instance);
+ String cls = (this.instance != null) ? String.format(" (%s)", this.instance) : "";
+ return String.format("%s%s",
+ this.type,
+ cls);
}
@Override public boolean equals(Object other) {
- /**
- * We can say two types are equal, as
- * long as they are not equal on a
- * type error!
- */
return (other instanceof TypeBundle) &&
- this.hasChecked() &&
((TypeBundle) other).type == this.type;
}
- public boolean hasChecked() {
- return type != TypeEnum.ERROR;
+ public boolean isClass() {
+ return this.type == TypeEnum.classname;
+ }
+
+ public boolean isMethod() {
+ return this.type == TypeEnum.method;
+ }
+
+ public boolean isArray() {
+ return this.type == TypeEnum.intarray;
+ }
+
+ public boolean isBool() {
+ return this.type == TypeEnum.bool;
+ }
+
+ public boolean isInt() {
+ return this.type == TypeEnum.integer;
}
}