summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/util/Set.scala
blob: dab7898e390c76d6df98a427de8cf9d2ca3745c1 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
/* NSC -- new scala compiler
 * Copyright 2005 LAMP/EPFL
 * @author  Martin Odersky
 */
// $Id$
package scala.tools.nsc.util;

/** A common trait for lightweight sets.
 */
abstract class Set[T <: AnyRef] {

  def findEntry(x: T): T;

  def addEntry(x: T): unit;

  def elements: Iterator[T];

  def contains(x: T): boolean =
    findEntry(x) != null;

  def toList = elements.toList;

}