JML

org.jmlspecs.models
Class JMLValueToValueRelationImageEnumerator

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

public class JMLValueToValueRelationImageEnumerator
extends Object
implements JMLEnumeration, JMLValueType

Enumerator for pairs of keys and their relational images. This enumerator returns pairs of type JMLValueValuePair, each of which has a "key" field of type JMLType and a "value" field of type JMLValueSets containing JMLType.

Version:
$Revision: 1.23 $
Author:
Gary T. Leavens
See Also:
JMLEnumeration, JMLValueType, JMLValueToValueRelationEnumerator, JMLValueToValueRelation, JMLValueToValueMap, JMLEnumerationToIterator, JMLValueSet

Field Summary
protected  JMLValueSetEnumerator pairEnum
          An enumerator for the image pairs in this relation.
 
Constructor Summary
protected JMLValueToValueRelationImageEnumerator(JMLValueSetEnumerator pEnum)
           
(package private) JMLValueToValueRelationImageEnumerator(JMLValueToValueRelation rel)
          Initialize this with the given relation.
 
Method Summary
protected  JMLValueSet abstractValue()
          Return the set of uniterated pairs from this enumerator.
 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 image pair in this, if there is one.
 JMLValueValuePair nextImagePair()
          Return the next image pair in this, if there is one.
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

pairEnum

protected JMLValueSetEnumerator pairEnum
An enumerator for the image pairs in this relation.

Constructor Detail

JMLValueToValueRelationImageEnumerator

JMLValueToValueRelationImageEnumerator(JMLValueToValueRelation rel)
Initialize this with the given relation.


JMLValueToValueRelationImageEnumerator

protected JMLValueToValueRelationImageEnumerator(JMLValueSetEnumerator pEnum)
Method Detail

hasMoreElements

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

Specified by:
hasMoreElements in interface JMLEnumeration
See Also:
nextElement(), nextImagePair()

nextElement

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

Specified by:
nextElement in interface Enumeration
Throws:
JMLNoSuchElementException - when this is empty.
See Also:
hasMoreElements(), nextImagePair()

nextImagePair

public JMLValueValuePair nextImagePair()
                                throws JMLNoSuchElementException
Return the next image pair in this, if there is one.

Throws:
JMLNoSuchElementException - when this is empty.
See Also:
hasMoreElements(), nextElement()

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

abstractValue

protected JMLValueSet abstractValue()
Return the set of uniterated pairs from this enumerator.


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.