coins.alias.util
クラス BriggsSet

java.lang.Object
  |
  +--coins.alias.util.BriggsSet

public class BriggsSet
extends java.lang.Object

Set of unsigned integers implemented using two arrays. It has constant time performance for search, insertion, deletion, and initialization (emptying) operations. Scanning all the elements takes time proportional to the size of the set. The largest integer (plus 1) that can enter the set has to be specified when instatiating this class, and the instatiation itself takes time proportional to the number specified.

関連項目:
"D. Morgan, Building an Optimizing Compiler, pp.90-92"

コンストラクタの概要
BriggsSet(int pSize)
          Creates a new instance of BriggsSet
 
メソッドの概要
 boolean deleteElement(int pElem)
          Tries to delete the given element from this set.
 boolean findElement(int pElem)
          Searches for the given element.
 boolean insertElement(int pElem)
          Tries to insert the given element into this set.
 void makeSetEmpty()
          Initializes the set.
 Scanner scanner()
          Returns the scanner that iterates through this set.
 
クラス java.lang.Object から継承したメソッド
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

コンストラクタの詳細

BriggsSet

public BriggsSet(int pSize)
Creates a new instance of BriggsSet

パラメータ:
pSize - the grand upper size, or the largest number that can enter the set plus one.
メソッドの詳細

makeSetEmpty

public void makeSetEmpty()
Initializes the set.


findElement

public boolean findElement(int pElem)
Searches for the given element.

パラメータ:
pElem - the element to search for.
戻り値:
true if the element was found.

insertElement

public boolean insertElement(int pElem)
Tries to insert the given element into this set.

パラメータ:
pElem - the element to insert.
戻り値:
true if insertion really took place.

deleteElement

public boolean deleteElement(int pElem)
Tries to delete the given element from this set.

パラメータ:
pElem - the element to delete.
戻り値:
true if deletion really took place.

scanner

public Scanner scanner()
Returns the scanner that iterates through this set.