summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorschinz <schinz@epfl.ch>2005-02-17 14:08:26 +0000
committerschinz <schinz@epfl.ch>2005-02-17 14:08:26 +0000
commitf714a29dd624886cb48683f5c902008cdb2a5443 (patch)
treed4b38f3228e171d3013363b26e47395d4ee5fcd4
parentb2dc4a423342a4851a315a455afd28a09bc5354f (diff)
downloadscala-f714a29dd624886cb48683f5c902008cdb2a5443.tar.gz
scala-f714a29dd624886cb48683f5c902008cdb2a5443.tar.bz2
scala-f714a29dd624886cb48683f5c902008cdb2a5443.zip
- removed Refinement.java, now useless
-rw-r--r--sources/scala/runtime/types/Refinement.java68
1 files changed, 0 insertions, 68 deletions
diff --git a/sources/scala/runtime/types/Refinement.java b/sources/scala/runtime/types/Refinement.java
deleted file mode 100644
index 0b32097868..0000000000
--- a/sources/scala/runtime/types/Refinement.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/* __ *\
-** ________ ___ / / ___ Scala API **
-** / __/ __// _ | / / / _ | (c) 2003, LAMP/EPFL **
-** __\ \/ /__/ __ |/ /__/ __ | **
-** /____/\___/_/ |_/____/_/ | | **
-** |/ **
-\* */
-
-// $Id$
-
-package scala.runtime.types;
-
-import scala.Type;
-
-/**
- * Refinement for a class member.
- *
- * @author Michel Schinz
- * @version 1.0
- */
-
-public class Refinement {
- public final static Refinement[] EMPTY_ARRAY = new Refinement[0];
-
- public final int hash;
- public final Type type;
-
- public Refinement(int hash, Type type) {
- this.hash = hash;
- this.type = type;
- }
-
- public boolean isSameAs(Refinement that) {
- return (this.hash == that.hash) && this.type.isSameAs(that.type);
- }
-
- public boolean isFinerThan(Refinement that) {
- return (this.hash == that.hash) && this.type.isSubType(that.type);
- }
-
- public static boolean isFiner(Refinement[] r1, Refinement[] r2) {
- for (int i2 = 0, i1 = 0; i2 < r2.length; ++i2) {
- Refinement r = r2[i2];
- while (i1 < r1.length && r1[i1].hash != r.hash)
- ++i1;
-
- if (i1 == r1.length || !r1[i1].isFinerThan(r))
- return false;
- }
- return true;
- }
-
- public static Refinement[] make(ScalaClassType[] parents,
- Refinement[] base,
- int[] code) {
- int pc = 0;
- int len = code[pc++];
- Refinement[] result = new Refinement[len];
- for (int i = 0; i < len; ++i) {
- int par = code[pc++], idx = code[pc++];
- result[i] = (par == -1)
- ? base[idx]
- : parents[par].refinements[idx];
- }
- assert pc == code.length;
- return result;
- }
-}