org.jmlspecs.models
Class JMLObjectToObjectRelationImageEnumerator
java.lang.Object
org.jmlspecs.models.JMLObjectToObjectRelationImageEnumerator
- All Implemented Interfaces:
- Cloneable, Enumeration, JMLEnumeration, JMLType, JMLValueType, Serializable
- public class JMLObjectToObjectRelationImageEnumerator
- extends Object
- implements JMLEnumeration, JMLValueType
Enumerator for pairs of keys and their relational images. This
enumerator returns pairs of type JMLObjectValuePair
,
each of which has a "key" field of type Object
and a
"value" field of type JMLObjectSet
s containing Object
.
- Version:
- $Revision: 1.23 $
- Author:
- Gary T. Leavens
- See Also:
JMLEnumeration
,
JMLValueType
,
JMLObjectToObjectRelationEnumerator
,
JMLObjectToObjectRelation
,
JMLObjectToObjectMap
,
JMLEnumerationToIterator
,
JMLValueSet
Class Specifications |
protected invariant this.moreElements <==> this.pairEnum.moreElements;
public invariant this.elementType == \type(org.jmlspecs.models.JMLObjectValuePair);
public invariant !this.returnsNull;
protected represents uniteratedImagePairs <- this.abstractValue(); |
Specifications inherited from class Object |
represents objectState <- org.jmlspecs.lang.JMLDataGroup.IT;
public represents _getClass <- \typeof(this); |
Specifications inherited from interface JMLEnumeration |
instance public represents moreElements <- this.hasMoreElements(); |
Method Summary |
[spec_public] protected JMLValueSet |
abstractValue()
Return the set of uniterated pairs from this enumerator. |
Object |
clone()
Return a clone of this enumerator. |
boolean |
equals(nullable 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. |
JMLObjectValuePair |
nextImagePair()
Return the next image pair in this, if there is one. |
uniteratedImagePairs
public JMLValueSet uniteratedImagePairs
- Specifications:
is in groups: objectState
datagroup contains: pairEnum
pairEnum
protected JMLValueSetEnumerator pairEnum
- An enumerator for the image pairs in this relation.
- Specifications: non_null
is in groups: uniteratedImagePairs
JMLObjectToObjectRelationImageEnumerator
JMLObjectToObjectRelationImageEnumerator(non_null JMLObjectToObjectRelation rel)
- Initialize this with the given relation.
- Specifications:
-
normal_behavior
requires rel != null;
assignable uniteratedImagePairs;
assignable moreElements, elementType, returnsNull, owner;
ensures this.uniteratedImagePairs.equals(rel.imagePairSet());
ensures this.owner == null;
JMLObjectToObjectRelationImageEnumerator
protected JMLObjectToObjectRelationImageEnumerator(non_null JMLValueSetEnumerator pEnum)
- Specifications:
-
normal_behavior
requires pEnum != null;
assignable uniteratedImagePairs;
assignable moreElements, elementType, returnsNull, owner;
ensures this.owner == null;
hasMoreElements
public boolean hasMoreElements()
- Tells whether this enumerator has more uniterated elements.
- Specified by:
hasMoreElements
in interface JMLEnumeration
- See Also:
nextElement()
,
nextImagePair()
- Specifications: (inherited)pure
- also
-
public normal_behavior
ensures \result == !this.uniteratedImagePairs.isEmpty();
- Specifications inherited from overridden method in interface JMLEnumeration:
pure- also
-
assignable \nothing;
- Specifications inherited from overridden method in interface Enumeration:
-
public normal_behavior
assignable objectState;
ensures \result <==> this.moreElements;
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()
- Specifications:
- also
-
public normal_behavior
requires !this.uniteratedImagePairs.isEmpty();
assignable uniteratedImagePairs;
ensures \old(this.uniteratedImagePairs).has((org.jmlspecs.models.JMLType)\result )&&this.uniteratedImagePairs.equals(\old(this.uniteratedImagePairs).remove((org.jmlspecs.models.JMLType)\result ));
- also
-
public exceptional_behavior
requires this.uniteratedImagePairs.isEmpty();
assignable \nothing;
signals_only org.jmlspecs.models.JMLNoSuchElementException;
- Specifications inherited from overridden method in interface Enumeration:
nullable -
public normal_behavior
requires this.moreElements;
assignable objectState;
assignable moreElements;
ensures (\result == null)||\typeof(\result ) <: this.elementType;
ensures !this.returnsNull ==> (\result != null);
- also
-
public exceptional_behavior
requires !this.moreElements;
assignable \nothing;
signals_only java.util.NoSuchElementException;
nextImagePair
public JMLObjectValuePair nextImagePair()
throws JMLNoSuchElementException
- Return the next image pair in this, if there is one.
- Throws:
JMLNoSuchElementException
- when this is empty.- See Also:
hasMoreElements()
,
nextElement()
- Specifications: non_null
-
public normal_behavior
requires !this.uniteratedImagePairs.isEmpty();
assignable uniteratedImagePairs, moreElements;
ensures \old(this.uniteratedImagePairs).has(\result )&&this.uniteratedImagePairs.equals(\old(this.uniteratedImagePairs).remove(\result ));
- also
-
public exceptional_behavior
requires this.uniteratedImagePairs.isEmpty();
assignable \nothing;
signals_only org.jmlspecs.models.JMLNoSuchElementException;
- also
-
assignable uniteratedImagePairs;
assignable moreElements;
ensures \old(this.moreElements);
signals_only org.jmlspecs.models.JMLNoSuchElementException;
signals (org.jmlspecs.models.JMLNoSuchElementException) \old(!this.moreElements);
clone
public Object clone()
- Return a clone of this enumerator.
- Specified by:
clone
in interface JMLEnumeration
- Overrides:
clone
in class Object
- Specifications: non_null (inherited)pure
- Specifications inherited from overridden method in class Object:
non_null -
protected normal_behavior
requires this instanceof java.lang.Cloneable;
assignable \nothing;
ensures \result != null;
ensures \typeof(\result ) == \typeof(this);
ensures (* \result is a clone of this *);
- also
-
protected normal_behavior
requires this.getClass().isArray();
assignable \nothing;
ensures \elemtype(\typeof(\result )) == \elemtype(\typeof(this));
ensures ((java.lang.Object[])\result ).length == ((java.lang.Object[])this).length;
ensures ( \forall int i; 0 <= i&&i < ((java.lang.Object[])this).length; ((java.lang.Object[])\result )[i] == ((java.lang.Object[])this)[i]);
- also
-
requires this.getClass().isArray();
assignable \nothing;
ensures \elemtype(\typeof(\result )) == \elemtype(\typeof(this));
ensures java.lang.reflect.Array.getLength(\result ) == java.lang.reflect.Array.getLength(this);
ensures ( \forall int i; 0 <= i&&i < java.lang.reflect.Array.getLength(this); ( \exists java.lang.Object result_i; result_i == java.lang.reflect.Array.get(\result ,i); (result_i == null&&java.lang.reflect.Array.get(this,i) == null)||(result_i != null&&result_i.equals(java.lang.reflect.Array.get(this,i)))));
- also
-
protected exceptional_behavior
requires !(this instanceof java.lang.Cloneable);
assignable \nothing;
signals_only java.lang.CloneNotSupportedException;
- also
-
protected normal_behavior
requires \elemtype(\typeof(this)) <: \type(java.lang.Object);
assignable \nothing;
ensures \elemtype(\typeof(\result )) == \elemtype(\typeof(this));
ensures ((java.lang.Object[])\result ).length == ((java.lang.Object[])this).length;
ensures ( \forall int i; 0 <= i&&i < ((java.lang.Object[])this).length; ((java.lang.Object[])\result )[i] == ((java.lang.Object[])this)[i]);
- also
-
protected normal_behavior
requires \elemtype(\typeof(this)) == \type(int);
assignable \nothing;
ensures \elemtype(\typeof(\result )) == \elemtype(\typeof(this));
ensures ((int[])\result ).length == ((int[])this).length;
ensures ( \forall int i; 0 <= i&&i < ((int[])this).length; ((int[])\result )[i] == ((int[])this)[i]);
- also
-
protected normal_behavior
requires \elemtype(\typeof(this)) == \type(byte);
assignable \nothing;
ensures \elemtype(\typeof(\result )) == \elemtype(\typeof(this));
ensures ((byte[])\result ).length == ((byte[])this).length;
ensures ( \forall int i; 0 <= i&&i < ((byte[])this).length; ((byte[])\result )[i] == ((byte[])this)[i]);
- also
-
protected normal_behavior
requires \elemtype(\typeof(this)) == \type(char);
assignable \nothing;
ensures \elemtype(\typeof(\result )) == \elemtype(\typeof(this));
ensures ((char[])\result ).length == ((char[])this).length;
ensures ( \forall int i; 0 <= i&&i < ((char[])this).length; ((char[])\result )[i] == ((char[])this)[i]);
- also
-
protected normal_behavior
requires \elemtype(\typeof(this)) == \type(long);
assignable \nothing;
ensures \elemtype(\typeof(\result )) == \elemtype(\typeof(this));
ensures ((long[])\result ).length == ((long[])this).length;
ensures ( \forall int i; 0 <= i&&i < ((long[])this).length; ((long[])\result )[i] == ((long[])this)[i]);
- also
-
protected normal_behavior
requires \elemtype(\typeof(this)) == \type(short);
assignable \nothing;
ensures \elemtype(\typeof(\result )) == \elemtype(\typeof(this));
ensures ((short[])\result ).length == ((short[])this).length;
ensures ( \forall int i; 0 <= i&&i < ((short[])this).length; ((short[])\result )[i] == ((short[])this)[i]);
- also
-
protected normal_behavior
requires \elemtype(\typeof(this)) == \type(boolean);
assignable \nothing;
ensures \elemtype(\typeof(\result )) == \elemtype(\typeof(this));
ensures ((boolean[])\result ).length == ((boolean[])this).length;
ensures ( \forall int i; 0 <= i&&i < ((boolean[])this).length; ((boolean[])\result )[i] == ((boolean[])this)[i]);
- also
-
protected normal_behavior
requires \elemtype(\typeof(this)) == \type(float);
assignable \nothing;
ensures \elemtype(\typeof(\result )) == \elemtype(\typeof(this));
ensures ((float[])\result ).length == ((float[])this).length;
ensures ( \forall int i; 0 <= i&&i < ((float[])this).length; (java.lang.Float.isNaN(((float[])\result )[i])&&java.lang.Float.isNaN(((float[])this)[i]))||((float[])\result )[i] == ((float[])this)[i]);
- also
-
protected normal_behavior
requires \elemtype(\typeof(this)) == \type(double);
assignable \nothing;
ensures \elemtype(\typeof(\result )) == \elemtype(\typeof(this));
ensures ((double[])\result ).length == ((double[])this).length;
ensures ( \forall int i; 0 <= i&&i < ((double[])this).length; (java.lang.Double.isNaN(((double[])\result )[i])&&java.lang.Double.isNaN(((double[])this)[i]))||((double[])\result )[i] == ((double[])this)[i]);
- Specifications inherited from overridden method in interface JMLEnumeration:
--- None ---
- Specifications inherited from overridden method in interface JMLValueType:
pure- also
-
public normal_behavior
ensures \result instanceof org.jmlspecs.models.JMLValueType&&(* all externally-visible mutable objects contained directly in "this" must be cloned in \result. *);
- implies_that
-
ensures (* no direct aliases are created between this and \result *);
- Specifications inherited from overridden method in interface JMLType:
pure- also
-
public normal_behavior
ensures \result != null;
ensures \result instanceof org.jmlspecs.models.JMLType;
ensures ((org.jmlspecs.models.JMLType)\result ).equals(this);
- implies_that
-
ensures \result != null&&\typeof(\result ) <: \type(org.jmlspecs.models.JMLType);
equals
public boolean equals(nullable 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
- Specifications: (inherited)pure
- Specifications inherited from overridden method equals(Object obj) in class Object:
pure -
public normal_behavior
requires obj != null;
ensures (* \result is true when obj is "equal to" this object *);
- also
-
public normal_behavior
requires this == obj;
ensures \result ;
- also
-
public code normal_behavior
requires obj != null;
ensures \result <==> this == obj;
- also
-
diverges false;
ensures obj == null ==> !\result ;
- Specifications inherited from overridden method equals(Object ob2) in interface JMLValueType:
pure- also
-
public normal_behavior
ensures \result ==> ob2 != null&&(* all externally-visible objects contained in ob2 test as ".equals()" to the corresponding object in this (and vice versa) *);
- Specifications inherited from overridden method equals(Object ob2) in interface JMLType:
pure- also
-
public normal_behavior
ensures \result ==> ob2 != null&&(* ob2 is not distinguishable from this, except by using mutation or == *);
- implies_that
-
public normal_behavior
{|-
requires ob2 != null&&ob2 instanceof org.jmlspecs.models.JMLType;
ensures ((org.jmlspecs.models.JMLType)ob2).equals(this) == \result ;
- also
-
requires ob2 == this;
ensures \result <==> true;
- |}
hashCode
public int hashCode()
- Return a hash code for this enumerator.
- Specified by:
hashCode
in interface JMLType
- Overrides:
hashCode
in class Object
- Specifications: (inherited)pure
- Specifications inherited from overridden method in class Object:
-
public behavior
assignable objectState;
ensures (* \result is a hash code for this object *);
- also
-
public code normal_behavior
assignable \nothing;
- Specifications inherited from overridden method in interface JMLType:
pure
abstractValue
protected JMLValueSet abstractValue()
- Return the set of uniterated pairs from this enumerator.
- Specifications: pure spec_public non_null
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.