org.jmlspecs.jmlunit
Class TestClassGenerator.MethodsIterator
java.lang.Object
org.jmlspecs.jmlunit.TestClassGenerator.MethodsIterator
- All Implemented Interfaces:
- Iterator
- Enclosing class:
- TestClassGenerator
- protected class TestClassGenerator.MethodsIterator
- extends Object
- implements Iterator
A composite control abstraction useful in this class.
Class Specifications |
private represents moreElements <- this.cache != null; |
Specifications inherited from class Object |
represents objectState <- org.jmlspecs.lang.JMLDataGroup.IT;
public represents _getClass <- \typeof(this); |
Specifications inherited from interface Iterator |
public invariant this.moreElements == this.hasNext(0); |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
methods
private Iterator methods
- The non-inherited methods.
- Specifications: non_null
is in groups: objectState
maps methods.objectState \into objectState
inheritedMethods
private Iterator inheritedMethods
- The inherited methods.
- Specifications: non_null
is in groups: objectState
maps inheritedMethods.objectState \into objectState
cache
private TestClassGenerator.MethodInfo cache
- Cached method to return next, null if none
- Specifications:
is in groups: objectState
TestClassGenerator.MethodsIterator
public TestClassGenerator.MethodsIterator(List methods,
List inhMeths)
- Initialize this methods iter.
- Specifications:
-
requires methods != null;
assignable objectState;
compositeHasNext
private boolean compositeHasNext()
- Does the composition have more elements?
- Specifications:
-
assignable objectState;
ensures \result <==> this.methods.moreElements||this.inheritedMethods.moreElements;
compositeNextMethod
private Object compositeNextMethod()
- Return the next element in the composition
- Specifications:
-
assignable methods.objectState, inheritedMethods.objectState;
cacheNext
private void cacheNext()
- Advance the state of the iteration to point to the next
testable method declaration.
- Specifications:
-
assignable objectState;
hasNext
public boolean hasNext()
- Specified by:
hasNext
in interface Iterator
- Specifications: pure
- Specifications inherited from overridden method in interface Iterator:
-
public normal_behavior
assignable objectState;
ensures \result <==> this.moreElements;
next
public Object next()
- Specified by:
next
in interface Iterator
- Specifications:
- also
-
assignable objectState;
- Specifications inherited from overridden method in interface Iterator:
-
public normal_behavior
requires this.moreElements;
requires_redundantly this.hasNext(0);
assignable objectState, remove_called_since, moreElements;
ensures !this.remove_called_since;
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;
nextMethod
public TestClassGenerator.MethodInfo nextMethod()
- Return the next testable method
- Specifications:
-
assignable objectState;
remove
public void remove()
- Specified by:
remove
in interface Iterator
- Specifications inherited from overridden method in interface Iterator:
-
public behavior
assignable objectState, remove_called_since;
ensures !\old(this.remove_called_since)&&this.remove_called_since;
signals_only java.lang.UnsupportedOperationException, java.lang.IllegalStateException;
signals (java.lang.UnsupportedOperationException) (* if this iterator does not support removing elements *);
signals (java.lang.IllegalStateException) \old(this.remove_called_since);
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.