org.jutil.java.collections
Class Singleton.SingletonIterator

java.lang.Object
  |
  +--org.jutil.java.collections.Singleton.SingletonIterator
All Implemented Interfaces:
java.util.Iterator
Enclosing class:
Singleton

public class Singleton.SingletonIterator
extends java.lang.Object
implements java.util.Iterator


Class Specifications
depends onlyElementNotReturnedYet <- $calledOnce;
represents onlyElementNotReturnedYet <- !$calledOnce;

Model Field Summary
 boolean onlyElementNotReturnedYet
           
 
Constructor Summary
Singleton.SingletonIterator()
           
 
Method Summary
 boolean hasNext()
          See superclass
 java.lang.Object next()
          See superclass
 void remove()
          See superclass
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Model Field Detail

onlyElementNotReturnedYet

public boolean onlyElementNotReturnedYet
Constructor Detail

Singleton.SingletonIterator

public Singleton.SingletonIterator()
Method Detail

hasNext

public boolean hasNext()
See superclass

Specifications:
     also
public behavior
ensures \result == onlyElementNotReturnedYet;

next

public java.lang.Object next()
See superclass

Specifications:
     also
public behavior
ensures \result == getOnlyElement();
ensures onlyElementNotReturnedYet == false;
signals (NoSuchElementException) (\old(!onlyElementNotReturnedYet));

remove

public void remove()
            throws java.lang.UnsupportedOperationException
See superclass

Specifications:
     also
public behavior
ensures false;
signals (UnsupportedOperationException) true;