summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/util/Set.scala
blob: 8f39f07d0530bc058d324d954cb133d6709dbdfd (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
24
/* NSC -- new Scala compiler
 * Copyright 2005-2009 LAMP/EPFL
 * @author  Martin Odersky
 */
// $Id$

package scala.tools.nsc.util

/** A common class 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) ne null

  def toList = elements.toList

}