JML

org.jmlspecs.samples.sets
Class IntegerSetAsHashSet

java.lang.Object
  extended byorg.jmlspecs.samples.sets.IntegerSetAsHashSet
All Implemented Interfaces:
IntegerSetInterface

public class IntegerSetAsHashSet
extends Object
implements IntegerSetInterface

A set of integers as a HashSet.

Author:
Katie Becker, Gary T. Leavens

Field Summary
private  HashSet hset
           
 
Constructor Summary
IntegerSetAsHashSet()
          Return the abstract value of this IntegerSetAsHashSet.
 
Method Summary
 void insert(int i)
          Insert the given integer into this set.
 boolean isMember(int i)
          Tell if the argument is in this set.
 void remove(int i)
          Remove the given integer from this set.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

hset

private HashSet hset
Constructor Detail

IntegerSetAsHashSet

public IntegerSetAsHashSet()
Return the abstract value of this IntegerSetAsHashSet. Initialize this set to be the empty set.

Method Detail

isMember

public boolean isMember(int i)
Description copied from interface: IntegerSetInterface
Tell if the argument is in this set.

Specified by:
isMember in interface IntegerSetInterface

insert

public void insert(int i)
Description copied from interface: IntegerSetInterface
Insert the given integer into this set.

Specified by:
insert in interface IntegerSetInterface

remove

public void remove(int i)
Description copied from interface: IntegerSetInterface
Remove the given integer from this set.

Specified by:
remove in interface IntegerSetInterface

toString

public String toString()
Overrides:
toString in class Object

JML

JML is Copyright (C) 1998-2002 by Iowa State University and is distributed under the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This release depends on code from the MultiJava project and is based in part on the Kopi project Copyright (C) 1990-99 DMS Decision Management Systems Ges.m.b.H.