JML

org.jmlspecs.models
Class JMLValueToObjectRelationEnumerator

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

public class JMLValueToObjectRelationEnumerator
extends Object
implements JMLEnumeration, JMLValueType

Enumerator for pairs of keys of type JMLType to values of type Object that form the associations in a relation.

Version:
$Revision: 1.41 $
Author:
Gary T. Leavens
See Also:
JMLEnumeration, JMLValueType, JMLValueToObjectRelationImageEnumerator, JMLValueToObjectRelation, JMLValueToObjectMap, JMLEnumerationToIterator, JMLValueSet

Field Summary
protected  JMLObjectSetEnumerator imageEnum
          An enumerator for the range elements that are related to the key that have not yet been returned.
protected  JMLValueToObjectRelationImageEnumerator imagePairEnum
          An enumerator for the image pairs in this relation.
protected  JMLType key
          The current key for pairs being enumerated.
 
Constructor Summary
(package private) JMLValueToObjectRelationEnumerator(JMLValueToObjectRelation rel)
          Initialize this with the given relation.
protected JMLValueToObjectRelationEnumerator(JMLValueToObjectRelationImageEnumerator ipEnum, JMLObjectSetEnumerator iEnum, JMLType k)
           
 
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.
 JMLValueObjectPair nextPair()
          Return the next pair in this, if there is one.
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

imagePairEnum

protected JMLValueToObjectRelationImageEnumerator imagePairEnum
An enumerator for the image pairs in this relation.


key

protected JMLType key
The current key for pairs being enumerated.


imageEnum

protected JMLObjectSetEnumerator imageEnum
An enumerator for the range elements that are related to the key that have not yet been returned.

Constructor Detail

JMLValueToObjectRelationEnumerator

JMLValueToObjectRelationEnumerator(JMLValueToObjectRelation rel)
Initialize this with the given relation.


JMLValueToObjectRelationEnumerator

protected JMLValueToObjectRelationEnumerator(JMLValueToObjectRelationImageEnumerator ipEnum,
                                             JMLObjectSetEnumerator iEnum,
                                             JMLType k)
Method Detail

hasMoreElements

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

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

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(), nextPair()

nextPair

public JMLValueObjectPair nextPair()
                            throws JMLNoSuchElementException
Return the next 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.