JML

java.util
Class AbstractSet

java.lang.Object
  extended byjava.util.AbstractCollection
      extended byjava.util.AbstractSet
All Implemented Interfaces:
Collection, Set
Direct Known Subclasses:
HashSet, TreeSet

public abstract class AbstractSet
extends AbstractCollection
implements Set

JML's specification of java.util.AbstractSet.

Author:
Katie Becker

Class Specifications

Specifications inherited from class Object
represents objectState <- org.jmlspecs.lang.JMLDataGroup.IT;
public represents _getClass <- \typeof(this);

Specifications inherited from interface Set
instance public represents theCollection <- this.theSet.toBag();

Specifications inherited from interface Collection
instance public invariant this.elementType == this.theCollection.elementType;
instance public invariant this.containsNull == this.theCollection.containsNull;
instance public invariant !this.nullElementsSupported ==> !this.containsNull;

Model Field Summary
 
Model fields inherited from class java.lang.Object
_getClass, objectState, theString
 
Model fields inherited from interface java.util.Set
theSet
 
Model fields inherited from interface java.util.Collection
addOperationSupported, elementState, nullElementsSupported, removeOperationSupported, theCollection
 
Ghost Field Summary
 
Ghost fields inherited from class java.lang.Object
objectTimesFinalized, owner
 
Ghost fields inherited from interface java.util.Collection
containsNull, elementType
 
Constructor Summary
protected AbstractSet()
           
 
Model Method Summary
 
Model methods inherited from class java.lang.Object
hashValue
 
Model methods inherited from interface java.util.Collection
hashValue
 
Method Summary
 boolean equals(nullable Object o)
           
 int hashCode()
           
 boolean removeAll(Collection c)
           
 
Methods inherited from class java.util.AbstractCollection
add, addAll, clear, contains, containsAll, isEmpty, iterator, remove, retainAll, size, toArray, toArray, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Set
add, addAll, clear, contains, containsAll, isEmpty, iterator, remove, retainAll, size, toArray, toArray
 

Constructor Detail

AbstractSet

protected AbstractSet()
Specifications:
protected normal_behavior
assignable theSet;
ensures this.theSet != null&&this.theSet.isEmpty();
Method Detail

equals

public boolean equals(nullable Object o)
Specified by:
equals in interface Set
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 o) in interface Set:
       pure
     also
public normal_behavior
requires o instanceof java.util.Set;
ensures \result ==> this.theSet.equals(((java.util.Set)o).theSet);
Specifications inherited from overridden method in interface Collection:
      --- None ---

hashCode

public int hashCode()
Specified by:
hashCode in interface Set
Overrides:
hashCode in class Object
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 Set:
      --- None ---
Specifications inherited from overridden method in interface Collection:
      --- None ---

removeAll

public boolean removeAll(Collection c)
Specified by:
removeAll in interface Set
Overrides:
removeAll in class AbstractCollection
Specifications inherited from overridden method in class AbstractCollection:
      --- None ---
Specifications inherited from overridden method removeAll(Collection c) in interface Set:
     also
public behavior
assignable theCollection;
ensures this.theSet.equals(\old(this.theSet).difference(org.jmlspecs.models.JMLEqualsSet.convertFrom(c)))&&(\result ==> !this.theSet.equals(\old(this.theSet)));
Specifications inherited from overridden method removeAll(Collection c) in interface Collection:
public behavior
requires c != null;
requires this.elementType <: c.elementType;
requires !c.containsNull ==> !this.containsNull;
assignable theCollection;
ensures this.theCollection.equals(\old(this.theCollection).difference(c.theCollection));
signals_only java.lang.UnsupportedOperationException, java.lang.ClassCastException, java.lang.NullPointerException;
signals (java.lang.UnsupportedOperationException) (* this does not support removeAll *);
signals (java.lang.ClassCastException) (* the type of one or more of the elements in c is not supported by this *);
signals (java.lang.NullPointerException) (* argument contains null elements and this does not support null elements *);
     also
public exceptional_behavior
requires c == null;
assignable \nothing;
signals_only java.lang.NullPointerException;

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.