diff options
author | schinz <schinz@epfl.ch> | 2005-02-17 14:04:34 +0000 |
---|---|---|
committer | schinz <schinz@epfl.ch> | 2005-02-17 14:04:34 +0000 |
commit | 9d110b32d08dd1e9042af0f6f476a9e1016381a8 (patch) | |
tree | 98bbf75dbadfe4053fbc8e039437a4f078e5905a | |
parent | 28c2394d012195e38308bcd6fd5049bcde635b4c (diff) | |
download | scala-9d110b32d08dd1e9042af0f6f476a9e1016381a8.tar.gz scala-9d110b32d08dd1e9042af0f6f476a9e1016381a8.tar.bz2 scala-9d110b32d08dd1e9042af0f6f476a9e1016381a8.zip |
- renamed isSameAs to isSameType, to be consistent
-rw-r--r-- | sources/scala/Type.java | 10 | ||||
-rw-r--r-- | sources/scala/runtime/types/BasicType.java | 2 | ||||
-rw-r--r-- | sources/scala/runtime/types/ClassType.java | 2 | ||||
-rw-r--r-- | sources/scala/runtime/types/CompoundType.java | 4 | ||||
-rw-r--r-- | sources/scala/runtime/types/JavaRefArrayType.java | 6 | ||||
-rw-r--r-- | sources/scala/runtime/types/MethodType.java | 8 | ||||
-rw-r--r-- | sources/scala/runtime/types/SingleType.java | 2 | ||||
-rw-r--r-- | sources/scala/runtime/types/SpecialType.java | 2 | ||||
-rw-r--r-- | sources/scala/runtime/types/ValueType.java | 2 |
9 files changed, 18 insertions, 20 deletions
diff --git a/sources/scala/Type.java b/sources/scala/Type.java index 2ccba44e1d..866e7e244b 100644 --- a/sources/scala/Type.java +++ b/sources/scala/Type.java @@ -37,8 +37,6 @@ import scala.runtime.PearsonHash; */ abstract public class Type implements java.io.Serializable { - public static final Type[] EMPTY_ARRAY = new Type[]{}; - /** @meta method [?T](scala.Int) scala.Array[?T]; */ abstract public Array newArray(int size); @@ -51,11 +49,11 @@ abstract public class Type implements java.io.Serializable { */ abstract public boolean isInstance(Object o); - abstract public boolean isSameAs(Type that); + abstract public boolean isSameType(Type that); abstract public boolean isSubType(Type that); public boolean equals(Object that) { - return (that instanceof Type) && this.isSameAs((Type)that); + return (that instanceof Type) && this.isSameType((Type)that); } public int hashCode() { @@ -91,11 +89,11 @@ abstract public class Type implements java.io.Serializable { public static final TypeAllRef AllRef = new TypeAllRef(); public static final TypeAll All = new TypeAll(); - public static boolean isSameAs(Type[] these, Type[] those) { + public static boolean isSameType(Type[] these, Type[] those) { if (these.length != those.length) return false; for (int i = 0; i < these.length; ++i) { - if (!these[i].isSameAs(those[i])) + if (!these[i].isSameType(those[i])) return false; } return true; diff --git a/sources/scala/runtime/types/BasicType.java b/sources/scala/runtime/types/BasicType.java index 8557cf9578..3b3a4ab433 100644 --- a/sources/scala/runtime/types/BasicType.java +++ b/sources/scala/runtime/types/BasicType.java @@ -26,7 +26,7 @@ abstract public class BasicType extends Type { public boolean isSubType(Type that) { return false; // TODO } - public boolean isSameAs(Type that) { + public boolean isSameType(Type that) { return this == that; } } diff --git a/sources/scala/runtime/types/ClassType.java b/sources/scala/runtime/types/ClassType.java index eb0b99fb16..24518ab6bf 100644 --- a/sources/scala/runtime/types/ClassType.java +++ b/sources/scala/runtime/types/ClassType.java @@ -60,7 +60,7 @@ public class ClassType extends Type { return true; } - public boolean isSameAs(Type that) { + public boolean isSameType(Type that) { return (that instanceof ClassType) && (((ClassType)that).clazz == this.clazz); } diff --git a/sources/scala/runtime/types/CompoundType.java b/sources/scala/runtime/types/CompoundType.java index 96f8ac8604..bd53ea2aae 100644 --- a/sources/scala/runtime/types/CompoundType.java +++ b/sources/scala/runtime/types/CompoundType.java @@ -67,7 +67,7 @@ public class CompoundType extends Type { } } - public boolean isSameAs(Type that) { + public boolean isSameType(Type that) { if (that instanceof CompoundType) { CompoundType thatCT = (CompoundType)that; @@ -75,7 +75,7 @@ public class CompoundType extends Type { return false; for (int i = 0; i < components.length; ++i) { - if (!components[i].isSameAs(thatCT.components[i])) + if (!components[i].isSameType(thatCT.components[i])) return false; } diff --git a/sources/scala/runtime/types/JavaRefArrayType.java b/sources/scala/runtime/types/JavaRefArrayType.java index b4e80fee6a..466d537626 100644 --- a/sources/scala/runtime/types/JavaRefArrayType.java +++ b/sources/scala/runtime/types/JavaRefArrayType.java @@ -41,13 +41,13 @@ public class JavaRefArrayType extends Type { return (o instanceof Object[]); } - public boolean isSameAs(Type that) { + public boolean isSameType(Type that) { return (that instanceof JavaRefArrayType) - && (elemType.isSameAs(((JavaRefArrayType)that).elemType)); + && (elemType.isSameType(((JavaRefArrayType)that).elemType)); } public boolean isSubType(Type that) { - return isSameAs(that); + return isSameType(that); } public String toString() { diff --git a/sources/scala/runtime/types/MethodType.java b/sources/scala/runtime/types/MethodType.java index 08395bcba5..60c2b6455a 100644 --- a/sources/scala/runtime/types/MethodType.java +++ b/sources/scala/runtime/types/MethodType.java @@ -45,7 +45,7 @@ public class MethodType extends Type { return false; for (int i = 0; i < argTypes.length; ++i) { - if (! argTypes[i].isSameAs(thatMT.argTypes[i])) + if (! argTypes[i].isSameType(thatMT.argTypes[i])) return false; } return returnType.isSubType(thatMT.returnType); @@ -53,7 +53,7 @@ public class MethodType extends Type { return false; } - public boolean isSameAs(Type that) { + public boolean isSameType(Type that) { if (that instanceof MethodType) { MethodType thatMT = (MethodType)that; @@ -61,10 +61,10 @@ public class MethodType extends Type { return false; for (int i = 0; i < argTypes.length; ++i) { - if (! argTypes[i].isSameAs(thatMT.argTypes[i])) + if (! argTypes[i].isSameType(thatMT.argTypes[i])) return false; } - return returnType.isSameAs(thatMT.returnType); + return returnType.isSameType(thatMT.returnType); } else return false; diff --git a/sources/scala/runtime/types/SingleType.java b/sources/scala/runtime/types/SingleType.java index f27d5b85f8..94f85371ba 100644 --- a/sources/scala/runtime/types/SingleType.java +++ b/sources/scala/runtime/types/SingleType.java @@ -36,7 +36,7 @@ public class SingleType extends Type { return that.isInstance(instance); } - public boolean isSameAs(Type that) { + public boolean isSameType(Type that) { return (that instanceof SingleType) && (this.instance == ((SingleType)that).instance); } diff --git a/sources/scala/runtime/types/SpecialType.java b/sources/scala/runtime/types/SpecialType.java index 33d6925262..ad80a4feae 100644 --- a/sources/scala/runtime/types/SpecialType.java +++ b/sources/scala/runtime/types/SpecialType.java @@ -31,7 +31,7 @@ abstract public class SpecialType extends Type { return null; } - public boolean isSameAs(Type that) { + public boolean isSameType(Type that) { return this == that; } } diff --git a/sources/scala/runtime/types/ValueType.java b/sources/scala/runtime/types/ValueType.java index a4dad93f6a..77baacf56a 100644 --- a/sources/scala/runtime/types/ValueType.java +++ b/sources/scala/runtime/types/ValueType.java @@ -28,7 +28,7 @@ abstract public class ValueType extends Type { || that == Type.AnyVal || that == this; } - public boolean isSameAs(Type that) { + public boolean isSameType(Type that) { return this == that; } } |