diff options
-rw-r--r-- | src/compiler/scala/tools/nsc/matching/Npair.scala | 60 | ||||
-rw-r--r-- | src/compiler/scala/tools/nsc/matching/StateSetComparator.scala | 34 |
2 files changed, 0 insertions, 94 deletions
diff --git a/src/compiler/scala/tools/nsc/matching/Npair.scala b/src/compiler/scala/tools/nsc/matching/Npair.scala deleted file mode 100644 index b6d87cb270..0000000000 --- a/src/compiler/scala/tools/nsc/matching/Npair.scala +++ /dev/null @@ -1,60 +0,0 @@ -/* NSC -- new Scala compiler - * Copyright 2005-2006 LAMP/EPFL - * @author Burak Emir - */ -// $Id$ - -package scala.tools.nsc.matching - -import java.util.{HashMap, TreeSet} - -/** cartesian - */ - -/** Int x TreeSet[ Int ] - */ -case class Npair(nstate: Integer, nset: TreeSet) { - - override def equals(that: Any): Boolean = this match { - case Npair(nstate, nset) => - that match { - case Npair(_nstate, _nset) => - (nstate == _nstate) && (nset == _nset) - case _ => - false - } - case _ => - false - } - - override def toString(): String = this match { - case Npair(nstate, nset) => - //Integer dstate = (Integer) indexMap.get(nset); - "<n" + nstate.toString() + " in " + nset /*+" = d"+dstate*/ + ">"; - case _ => - null - } - - def toString(indexMap: HashMap): String = { - //assert indexMap != null - this match { - case Npair(nstate, nset) => - //assert nstate != null - val dstate = indexMap.get( nset ).asInstanceOf[Integer] - "<n" + nstate.toString() + " in " + nset + " = d" + dstate + ">" - case _ => - null - } - } - -} - -class NpairComparator extends StateSetComparator { - override def compare(o1: Any, o2: Any): Int = o1 match { - case Npair(nstate, nset) => o2 match { - case Npair(_nstate, _nset) => - val res = nstate.compareTo(_nstate) - if (res != 0) res else super.compare(nset, _nset) - } - } -} diff --git a/src/compiler/scala/tools/nsc/matching/StateSetComparator.scala b/src/compiler/scala/tools/nsc/matching/StateSetComparator.scala deleted file mode 100644 index 4caf8f9fa6..0000000000 --- a/src/compiler/scala/tools/nsc/matching/StateSetComparator.scala +++ /dev/null @@ -1,34 +0,0 @@ -/* NSC -- new Scala compiler - * Copyright 2005-2006 LAMP/EPFL - * @author Burak Emir - */ -// $Id$ - -package scala.tools.nsc.matching - -import java.util.{Comparator, TreeSet} - -class StateSetComparator extends Comparator { - - // use lexicographic order - def compare(o1: Any, o2: Any): Int = { - val it1 = o1.asInstanceOf[TreeSet].iterator() - val it2 = o2.asInstanceOf[TreeSet].iterator() - while (it1.hasNext()) { - while (it2.hasNext()) { - if (!it1.hasNext()) - return -1; - - val i1 = it1.next().asInstanceOf[Integer].intValue() - val i2 = it2.next().asInstanceOf[Integer].intValue() - if (i1 < i2) - return -1; - else if (i1 > i2) - return 1; - } - if (it1.hasNext()) - return 1; - } - if (it2.hasNext()) -1 else 0 - } -} |