JML

org.jmlspecs.models
Class JMLEqualsSetEnumerator

java.lang.Object
  extended byorg.jmlspecs.models.JMLEqualsSetEnumerator
All Implemented Interfaces:
Cloneable, Enumeration, JMLEnumeration, JMLObjectType, JMLType, Serializable

public class JMLEqualsSetEnumerator
extends Object
implements JMLEnumeration, JMLObjectType

An enumerator for sets of objects.

Version:
$Revision: 1.32 $
Author:
Gary T. Leavens, with help from Albert Baker, Clyde Ruby, and others.
See Also:
JMLEnumeration, JMLObjectType, JMLEqualsSet, JMLEnumerationToIterator

Field Summary
protected  JMLListEqualsNode currentNode
          The elements that have not yet been returned by nextElement.
 
Constructor Summary
(package private) JMLEqualsSetEnumerator(JMLEqualsSet s)
          Initialize this with the given set.
 
Method Summary
 Object clone()
          Return a clone of this enumerator.
 boolean equals(Object oth)
          Return true just when this enumerator has the same state as the given argument.
 int hashCode()
          Return a hash code for this enumerator.
 boolean hasMoreElements()
          Tells whether this enumerator has more uniterated elements.
 Object nextElement()
          Return the next element in this, if there is one.
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

currentNode

protected JMLListEqualsNode currentNode
The elements that have not yet been returned by nextElement. The list representing the elements that have not yet been returned by this enumerator.

Constructor Detail

JMLEqualsSetEnumerator

JMLEqualsSetEnumerator(JMLEqualsSet s)
Initialize this with the given set.

Method Detail

hasMoreElements

public boolean hasMoreElements()
Tells whether this enumerator has more uniterated elements.

Specified by:
hasMoreElements in interface JMLEnumeration

nextElement

public Object nextElement()
                   throws JMLNoSuchElementException
Return the next element in this, if there is one.

Specified by:
nextElement in interface Enumeration
Throws:
JMLNoSuchElementException - when this is empty.

clone

public Object clone()
Return a clone of this enumerator.

Specified by:
clone in interface JMLEnumeration
Overrides:
clone in class Object

equals

public boolean equals(Object oth)
Return true just when this enumerator has the same state as the given argument.

Specified by:
equals in interface JMLType
Overrides:
equals in class Object

hashCode

public int hashCode()
Return a hash code for this enumerator.

Specified by:
hashCode in interface JMLType
Overrides:
hashCode 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.