java.util
Class Vector
java.lang.Object
java.util.AbstractCollection
java.util.AbstractList
java.util.Vector
- All Implemented Interfaces:
- Cloneable, Collection, List, RandomAccess, Serializable
- Direct Known Subclasses:
- Stack
- public class Vector
- extends AbstractList
- implements List, RandomAccess, Cloneable, Serializable
JML's specification of java.util.Vector.
Some of this specification is taken from ESC/Java.
- Version:
- $Revision: 1.41 $
- Author:
- Clyde Ruby, Gary T. Leavens, David Cok
Class Specifications |
public invariant this.maxCapacity >= 0&&this.capIncrement >= 0&&this.theList.int_size() <= this.maxCapacity;
public invariant 0 <= this.elementCount;
public invariant this.elementCount == this.size();
public constraint this.capIncrement == \old(this.capIncrement);
protected represents theList <- org.jmlspecs.models.JMLEqualsSequence.convertFrom(this.elementData,this.elementCount);
public represents maxCapacity <- this.capacity();
protected represents capIncrement <- this.capacityIncrement; |
Specifications inherited from class AbstractList |
protected initially this.modCount == 0; |
Specifications inherited from class Object |
represents objectState <- org.jmlspecs.lang.JMLDataGroup.IT;
public represents _getClass <- \typeof(this); |
Specifications inherited from interface List |
instance public represents theCollection <- this.theList.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 fields inherited from interface java.util.List |
theList |
maxCapacity
public int maxCapacity
- Specifications:
is in groups: theList
capIncrement
public int capIncrement
- Specifications:
is in groups: theList
datagroup contains: capacityIncrement
elementData
protected Object[] elementData
- Specifications:
is in groups: theList
maps elementData[*] \into theList
elementCount
protected int elementCount
- Specifications: spec_public
is in groups: theList
capacityIncrement
protected int capacityIncrement
- Specifications:
is in groups: capIncrement
Vector
public Vector(int initialCapacity,
int capacityIncrement)
- Specifications: pure
-
public normal_behavior
requires initialCapacity >= 0&&capacityIncrement >= 0;
assignable theCollection, maxCapacity, capIncrement, elementType;
ensures this.maxCapacity == initialCapacity&&this.capIncrement == capacityIncrement;
ensures this.elementType == \type(java.lang.Object);
ensures this.isEmpty();
- implies_that
-
requires initialCapacity >= 0&&capacityIncrement >= 0;
ensures this.elementCount == 0;
ensures this.elementType == \type(java.lang.Object);
Vector
public Vector(int initialCapacity)
- Specifications: pure
-
public normal_behavior
requires initialCapacity >= 0;
assignable theCollection, maxCapacity, capIncrement, elementType, containsNull;
ensures this.maxCapacity == initialCapacity&&this.capIncrement >= 0;
ensures this.elementType == \type(java.lang.Object)&&!this.containsNull;
ensures this.isEmpty();
- implies_that
-
requires initialCapacity >= 0;
ensures this.elementCount == 0;
ensures this.elementType == \type(java.lang.Object);
Vector
public Vector()
- Specifications: pure
-
public normal_behavior
assignable theCollection, maxCapacity, capIncrement, elementType, containsNull;
ensures this.isEmpty();
ensures this.elementType == \type(java.lang.Object)&&!this.containsNull;
ensures this.maxCapacity > 0&&this.capIncrement >= 0;
- implies_that
-
ensures this.elementCount == 0;
ensures this.elementType == \type(java.lang.Object);
Vector
public Vector(non_null Collection c)
- Specifications: pure
-
public normal_behavior
requires c != null;
assignable theCollection, maxCapacity, capIncrement, elementType, containsNull;
ensures this.theCollection.equals(c.theCollection);
ensures_redundantly this.elementCount == c.size();
- implies_that
-
ensures this.elementType == c.elementType;
ensures this.containsNull == c.containsNull;
copyInto
public void copyInto(Object[] anArray)
- Specifications:
-
public normal_behavior
requires anArray != null&&this.size() <= anArray.length;
assignable anArray[0 .. this.size()-1];
ensures ( \forall int i; 0 <= i&&i < this.size(); this.get(i) == anArray[i]);
- also
-
requires this.elementType <: \elemtype(\typeof(anArray));
ensures ( \forall int i; 0 <= i&&i < this.elementCount; !this.containsNull ==> anArray[i] != null);
trimToSize
public void trimToSize()
- Specifications:
-
public normal_behavior
assignable maxCapacity;
ensures this.maxCapacity == this.size();
ensureCapacity
public void ensureCapacity(int minCapacity)
- Specifications:
-
public normal_behavior
{|-
requires minCapacity <= this.maxCapacity;
ensures true;
- also
-
requires minCapacity > this.maxCapacity;
assignable maxCapacity;
ensures this.maxCapacity == minCapacity;
- |}
setSize
public void setSize(int newSize)
- Specifications:
-
public normal_behavior
{|-
requires 0 <= newSize&&newSize <= this.theList.int_size();
assignable theCollection;
ensures this.theList.equals(\old(this.theList).prefix(newSize));
ensures_redundantly this.theList.int_size() == newSize;
- also
-
old int oldSize = this.theList.int_size();
requires newSize > this.theList.int_size();
assignable theCollection;
ensures this.theList.prefix(oldSize).equals(\old(this.theList))&&( \forall int i; oldSize <= i&&i < newSize; this.theList.itemAt(i) == null);
- |}
- also
-
exceptional_behavior
requires newSize < 0;
assignable \nothing;
signals_only java.lang.ArrayIndexOutOfBoundsException;
- implies_that
-
requires newSize >= 0;
requires this.containsNull;
capacity
public int capacity()
- Specifications: pure
-
public normal_behavior
assignable \nothing;
ensures \result == this.maxCapacity;
size
public int size()
- Specified by:
size
in interface List
- Specifications: pure
- also
-
public normal_behavior
assignable \nothing;
ensures \result == this.theList.int_size();
ensures_redundantly \result == this.elementCount;
- Specifications inherited from overridden method in class AbstractCollection:
pure- Specifications inherited from overridden method in interface List:
pure- Specifications inherited from overridden method in interface Collection:
pure -
public normal_behavior
assignable \nothing;
ensures \result == this.theCollection.int_size();
ensures \result >= 0;
isEmpty
public boolean isEmpty()
- Specified by:
isEmpty
in interface List
- Overrides:
isEmpty
in class AbstractCollection
- Specifications: pure
- also
-
public normal_behavior
assignable \nothing;
ensures \result == this.theList.isEmpty();
- Specifications inherited from overridden method in class AbstractCollection:
pure- Specifications inherited from overridden method in interface List:
pure- Specifications inherited from overridden method in interface Collection:
pure -
public normal_behavior
assignable \nothing;
ensures \result <==> this.theCollection.isEmpty();
- also
-
public normal_behavior
ensures \result == (this.size() == 0);
elements
public Enumeration elements()
- Specifications: pure non_null
-
public normal_behavior
assignable \nothing;
ensures (* \result is an Enumeration of this Vector *);
ensures \result != null&&\result .elementType == this.elementType&&\result .returnsNull == this.containsNull;
contains
public boolean contains(nullable Object elem)
- Specified by:
contains
in interface List
- Overrides:
contains
in class AbstractCollection
- Specifications: pure
- also
-
public normal_behavior
assignable \nothing;
ensures \result <==> this.theList.has(elem);
- Specifications inherited from overridden method in class AbstractCollection:
pure- Specifications inherited from overridden method in interface List:
pure- Specifications inherited from overridden method contains(Object o) in interface Collection:
pure -
public behavior
assignable \nothing;
ensures !this.containsNull&&o == null ==> !\result ;
ensures (o == null)||\typeof(o) <: this.elementType||!\result ;
ensures \result <==> this.theCollection.has(o);
signals_only java.lang.ClassCastException, java.lang.NullPointerException;
signals (java.lang.ClassCastException) (* \typeof(o) is incompatible with the elementType of this collection *);
signals (java.lang.NullPointerException) o == null;
indexOf
public int indexOf(Object elem)
- Specified by:
indexOf
in interface List
- Overrides:
indexOf
in class AbstractList
- Specifications: pure
- also
-
public normal_behavior
requires !this.contains(elem);
assignable \nothing;
ensures \result == -1;
- implies_that
-
public normal_behavior
ensures \result >= -1&&\result < this.elementCount;
- Specifications inherited from overridden method in class AbstractList:
pure- Specifications inherited from overridden method indexOf(Object o) in interface List:
pure -
public behavior
requires !this.containsNull ==> o != null;
requires (o == null)||\typeof(o) <: this.elementType;
assignable \nothing;
ensures \result != -1&&this.theList.get(\result ) == null ==> o == null;
ensures \result != -1&&this.theList.get(\result ) != null ==> this.theList.get(\result ).equals(o)&&this.theList.indexOf(o) == \result ;
ensures \result == -1&&!this.contains(o);
signals_only java.lang.ClassCastException, java.lang.NullPointerException;
signals (java.lang.ClassCastException) (* class of specified element is incompatible with this *);
signals (java.lang.NullPointerException) (* element is null and null elements are not supported by this *);
- implies_that
-
ensures \result != -1 ==> ( \forall int i; 0 <= i&&i < \result ; (this.theList.get(i) == null&&o != null)||(this.theList.get(i) != null&&!this.theList.get(i).equals(o)));
indexOf
public int indexOf(Object elem,
int index)
- Specifications: pure
-
public normal_behavior
requires this.theList.removePrefix(index).has(elem);
assignable \nothing;
ensures \result == (index < 0 ? 0 : index)+this.theList.removePrefix(index).indexOf(elem);
- also
-
public normal_behavior
requires !this.theList.removePrefix(index).has(elem);
assignable \nothing;
ensures \result == -1;
- implies_that
-
public normal_behavior
requires index >= 0;
assignable \nothing;
ensures \result >= -1&&\result < this.elementCount;
lastIndexOf
public int lastIndexOf(Object elem)
- Specified by:
lastIndexOf
in interface List
- Overrides:
lastIndexOf
in class AbstractList
- Specifications: pure
- also
-
public normal_behavior
{|-
requires this.contains(elem);
assignable \nothing;
ensures (this.theList.itemAt(\result ) == elem||this.theList.itemAt(\result ).equals(elem))&&!this.theList.removePrefix((int)(\result +1)).has(elem);
ensures_redundantly (* \result is the index of the last occurrence of obj in theList *);
- also
-
requires !this.contains(elem);
assignable \nothing;
ensures \result == -1;
- |}
- Specifications inherited from overridden method in class AbstractList:
pure- Specifications inherited from overridden method lastIndexOf(Object o) in interface List:
pure -
public behavior
requires !this.containsNull ==> o != null;
requires (o == null)||\typeof(o) <: this.elementType;
assignable \nothing;
ensures \result != -1&&this.theList.get(\result ) == null ==> o == null;
ensures \result != -1&&this.theList.get(\result ) != null ==> this.theList.get(\result ).equals(o)&&this.theList.reverse().indexOf(o) == this.theList.int_size()-(\result +1);
signals_only java.lang.ClassCastException, java.lang.NullPointerException;
signals (java.lang.ClassCastException) (* class of specified element is incompatible with this *);
signals (java.lang.NullPointerException) (* element is null and null elements are not supported by this *);
- implies_that
-
ensures \result != -1 ==> ( \forall int i; \result < i&&i < this.theList.int_size(); (this.theList.get(i) == null&&o != null)||(this.theList.get(i) != null&&!this.theList.get(i).equals(o)));
lastIndexOf
public int lastIndexOf(Object elem,
int index)
- Specifications: pure
-
public normal_behavior
requires index < this.theList.int_size();
{|-
requires this.theList.prefix((int)(index+1)).has(elem);
assignable \nothing;
ensures this.theList.itemAt(\result ) == elem||this.theList.itemAt(\result ).equals(elem);
ensures ( \forall int i; \result < i&&i <= index; this.theList.itemAt(i) != elem&&!this.theList.itemAt(i).equals(elem));
ensures_redundantly (* \result is the position of the last occurrence of obj in theList that is <= index *);
- also
-
requires index < 0||!this.theList.prefix((int)(index+1)).has(elem);
assignable \nothing;
ensures \result == -1;
- |}
- also
-
public exceptional_behavior
requires index >= this.theList.int_size();
assignable \nothing;
signals_only java.lang.IndexOutOfBoundsException;
- implies_that
-
ensures -1 <= \result &&\result < this.elementCount;
elementAt
public Object elementAt(int index)
- Specifications: pure
-
public normal_behavior
requires 0 <= index&&index < this.theList.int_size();
assignable \nothing;
ensures \result == this.theList.itemAt(index);
- also
-
public exceptional_behavior
requires !(0 <= index&&index < this.theList.int_size());
assignable \nothing;
signals_only java.lang.ArrayIndexOutOfBoundsException;
- implies_that
-
requires 0 <= index&&index < this.elementCount;
ensures \result == null||\typeof(\result ) <: this.elementType;
ensures !this.containsNull ==> \result != null;
firstElement
public Object firstElement()
- Specifications: pure
-
public normal_behavior
requires 0 < this.theList.int_size();
assignable \nothing;
ensures \result == this.theList.itemAt(0);
- also
-
public exceptional_behavior
requires 0 == this.theList.int_size();
assignable \nothing;
signals_only java.util.NoSuchElementException;
- implies_that
-
public normal_behavior
requires this.elementCount > 0;
assignable \nothing;
ensures \result == null||\typeof(\result ) <: this.elementType;
ensures !this.containsNull ==> \result != null;
lastElement
public Object lastElement()
- Specifications: pure
-
public normal_behavior
requires 0 < this.theList.int_size();
assignable \nothing;
ensures \result == this.theList.itemAt((int)(this.theList.int_size()-1));
- also
-
public exceptional_behavior
requires 0 == this.theList.int_size();
assignable \nothing;
signals_only java.util.NoSuchElementException;
- implies_that
-
public normal_behavior
requires this.elementCount > 0;
assignable \nothing;
ensures \result == null||\typeof(\result ) <: this.elementType;
ensures !this.containsNull ==> \result != null;
setElementAt
public void setElementAt(Object obj,
int index)
- Specifications:
-
public normal_behavior
requires 0 <= index&&index < this.theList.int_size();
assignable theCollection;
ensures this.theList.equals(\old(this.theList).replaceItemAt(index,obj));
- also
-
public exceptional_behavior
requires !(0 <= index&&index < this.theList.int_size());
assignable \nothing;
signals_only java.lang.ArrayIndexOutOfBoundsException;
- implies_that
-
requires 0 <= index&&index < this.elementCount;
requires \typeof(obj) <: this.elementType;
requires this.containsNull||obj != null;
removeElementAt
public void removeElementAt(int index)
- Specifications:
-
public normal_behavior
requires 0 <= index&&index < this.theList.int_size();
assignable theCollection;
ensures this.theList.equals(\old(this.theList).removeItemAt(index));
- also
-
public exceptional_behavior
requires !(0 <= index&&index < this.theList.int_size());
assignable \nothing;
signals_only java.lang.ArrayIndexOutOfBoundsException;
- implies_that
-
requires 0 <= index&&index < this.elementCount;
assignable elementCount;
ensures this.elementCount == \old(this.elementCount)-1;
insertElementAt
public void insertElementAt(Object obj,
int index)
- Specifications:
-
public normal_behavior
requires obj == null||\typeof(obj) <: this.elementType;
requires !this.containsNull ==> obj != null;
requires 0 <= index&&index < this.theList.int_size();
assignable theCollection;
ensures this.theList.equals(\old(this.theList).insertBeforeIndex(index,obj));
- also
-
requires obj == null||\typeof(obj) <: this.elementType;
requires !this.containsNull ==> obj != null;
requires index == this.theList.int_size();
assignable theCollection;
ensures this.theList.equals(\old(this.theList).insertBack(obj));
- also
-
public exceptional_behavior
requires !(0 <= index&&index <= this.theList.int_size());
assignable \nothing;
signals_only java.lang.ArrayIndexOutOfBoundsException;
- also
-
public normal_behavior
requires 0 <= index&&index < this.theList.int_size();
requires \typeof(this) == \type(java.util.Vector);
{|-
requires this.theList.int_size() < this.maxCapacity;
ensures \not_modified(maxCapacity);
- also
-
requires this.theList.int_size() == this.maxCapacity;
{|-
requires this.capIncrement > 0;
assignable maxCapacity, theList;
ensures this.maxCapacity == \old(this.maxCapacity)+this.capIncrement;
- also
-
requires this.capIncrement == 0;
assignable maxCapacity, theList;
ensures this.maxCapacity == \old(this.maxCapacity)*2;
- |}
- |}
- implies_that
-
requires 0 <= index&&index <= this.elementCount;
requires obj == null||\typeof(obj) <: this.elementType;
requires !this.containsNull ==> obj != null;
addElement
public void addElement(Object obj)
- Specifications:
-
public normal_behavior
requires \typeof(obj) <: this.elementType;
requires this.containsNull||obj != null;
assignable theCollection;
ensures this.theList.equals(\old(this.theList).insertBack(obj));
ensures this.theList.int_size() <= this.maxCapacity;
- also
-
public normal_behavior
requires \typeof(this) == \type(java.util.Vector);
{|-
requires this.theList.int_size() < this.maxCapacity;
ensures \not_modified(maxCapacity)&&\not_modified(capIncrement);
- also
-
requires this.theList.int_size() == this.maxCapacity;
{|-
requires 0 < this.capIncrement&&this.maxCapacity <= 2147483647-this.capIncrement;
assignable maxCapacity, theList;
ensures this.maxCapacity == \old(this.maxCapacity)+this.capIncrement;
- also
-
requires this.capIncrement == 0&&this.maxCapacity == 0;
assignable maxCapacity, theList;
ensures this.maxCapacity == 1;
- also
-
requires this.capIncrement == 0&&this.maxCapacity > 0&&this.maxCapacity < 1073741823;
assignable maxCapacity, theList;
ensures this.maxCapacity == \old(this.maxCapacity)*2;
- |}
- |}
- also
-
requires obj == null||\typeof(obj) <: this.elementType;
requires this.containsNull||obj != null;
assignable elementCount;
ensures this.elementCount == \old(this.elementCount)+1;
removeElement
public boolean removeElement(Object obj)
- Specifications:
-
public normal_behavior
{|-
requires this.contains(obj);
assignable theCollection;
ensures this.theList.equals(\old(this.theList).removeItemAt(\old(this.theList).indexOf(obj)))&&\result ;
- also
-
requires !this.contains(obj);
ensures !\result ;
- |}
- implies_that
-
requires !this.containsNull ==> obj != null;
requires obj == null||\typeof(obj) <: this.elementType;
removeAllElements
public void removeAllElements()
- Specifications:
-
public normal_behavior
assignable theCollection;
ensures this.isEmpty();
clone
public Object clone()
- Overrides:
clone
in class Object
- Specifications:
- also
-
public normal_behavior
assignable \nothing;
ensures \result != this;
ensures \typeof(\result ) <: \type(java.util.Vector);
ensures ((java.util.Vector)\result ).size() == this.size();
ensures (* \result is a clone of this Vector *);
- 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]);
toArray
public Object[] toArray()
- Specified by:
toArray
in interface List
- Overrides:
toArray
in class AbstractCollection
- Specifications: pure
- also
-
public normal_behavior
assignable \nothing;
ensures \result != null&&\fresh(\result )&&\result .length == this.theList.int_size()&&( \forall int i; 0 <= i&&i < this.theList.int_size(); \result [i] == this.theList.itemAt(i));
- Specifications inherited from overridden method in class AbstractCollection:
pure- Specifications inherited from overridden method in interface List:
pure- also
-
public normal_behavior
requires this.size() < 2147483647;
assignable \nothing;
ensures \result != null;
ensures \result .length == this.size();
ensures ( \forall int i; 0 <= i&&i < this.size(); \result [i].equals(this.theList.get(i)));
- Specifications inherited from overridden method in interface Collection:
pure non_null -
public normal_behavior
requires this.size() < 2147483647;
assignable \nothing;
ensures \result != null;
ensures this.containsNull||\nonnullelements(\result );
ensures \result .length == this.size();
- also
-
public normal_behavior
ensures ( \forall int i; 0 <= i&&i < this.size(); this.theCollection.count(\result [i]) == org.jmlspecs.models.JMLArrayOps.valueEqualsCount(\result ,\result [i]));
toArray
public Object[] toArray(Object[] a)
- Specified by:
toArray
in interface List
- Overrides:
toArray
in class AbstractCollection
- Specifications:
- also
-
public normal_behavior
requires a != null&&( \forall int i; 0 <= i&&i < this.theList.int_size(); this.theList.itemAt(i) == null||\typeof(this.theList.itemAt(i)) <: \elemtype(\typeof(a)));
{|-
requires a.length < this.theList.int_size();
assignable \nothing;
ensures \result != null&&\fresh(\result )&&\result .length == this.theList.int_size()&&( \forall int i; 0 <= i&&i < this.theList.int_size(); \result [i] == this.theList.itemAt(i));
- also
-
requires a.length == this.theList.int_size();
assignable a[0 .. (this.theList.int_size()-1)];
ensures \result == a&&( \forall int i; 0 <= i&&i < this.theList.int_size(); \result [i] == this.theList.itemAt(i));
- also
-
requires a.length > this.theList.int_size();
assignable a[0 .. this.theList.int_size()];
ensures \result == a&&( \forall int i; 0 <= i&&i < this.theList.int_size(); \result [i] == this.theList.itemAt(i))&&\result [this.theList.int_size()] == null;
- |}
- Specifications inherited from overridden method in class AbstractCollection:
--- None ---
- Specifications inherited from overridden method toArray(Object[] a) in interface List:
- also
-
public normal_behavior
old int colSize = this.theCollection.int_size();
old int arrSize = a.length;
requires a != null&&colSize < 2147483647;
requires this.elementType <: \elemtype(\typeof(a));
requires ( \forall java.lang.Object o; this.contains(o); \typeof(o) <: \elemtype(\typeof(a)));
{|-
requires colSize <= arrSize;
assignable a[*];
ensures \result == a;
ensures ( \forall int k; 0 <= k&&k < colSize; this.theList.get(k) == \result [k]);
ensures ( \forall int i; colSize <= i&&i < arrSize; \result [i] == null);
- also
-
requires colSize > arrSize;
assignable \nothing;
ensures \fresh(\result )&&\result .length == colSize;
ensures ( \forall int k; 0 <= k&&k < colSize; this.theList.get(k) == \result [k]);
- |}
- Specifications inherited from overridden method toArray(Object[] a) in interface Collection:
non_null -
public normal_behavior
old int colSize = this.theCollection.int_size();
old int arrSize = a.length;
requires a != null&&colSize < 2147483647;
requires this.elementType <: \elemtype(\typeof(a));
requires ( \forall java.lang.Object o; this.contains(o); \typeof(o) <: \elemtype(\typeof(a)));
{|-
requires colSize <= arrSize;
assignable a[*];
ensures \result == a;
ensures ( \forall int k; 0 <= k&&k < colSize; this.theCollection.count(\result [k]) == org.jmlspecs.models.JMLArrayOps.valueEqualsCount(\result ,\result [k],colSize));
ensures ( \forall int i; colSize <= i&&i < arrSize; \result [i] == null);
ensures_redundantly \typeof(\result ) == \typeof(a);
- also
-
requires colSize > arrSize;
assignable \nothing;
ensures \fresh(\result )&&\result .length == colSize;
ensures ( \forall int k; 0 <= k&&k < colSize; this.theCollection.count(\result [k]) == org.jmlspecs.models.JMLArrayOps.valueEqualsCount(\result ,\result [k],colSize));
ensures ( \forall int k; 0 <= k&&k < colSize; \result [k] == null||\typeof(\result [k]) <: \elemtype(\typeof(\result )));
ensures \typeof(\result ) == \typeof(a);
- |}
- also
-
public exceptional_behavior
requires a == null;
assignable \nothing;
signals_only java.lang.NullPointerException;
- also
-
public behavior
requires a != null;
requires !( \forall java.lang.Object o; o != null&&this.contains(o); \typeof(o) <: \elemtype(\typeof(a)));
assignable a[*];
signals_only java.lang.ArrayStoreException;
get
public Object get(int index)
- Specified by:
get
in interface List
- Specifications: pure
- also
-
public normal_behavior
requires 0 <= index&&index < this.theList.int_size();
assignable \nothing;
ensures \result == this.theList.itemAt(index);
ensures !this.containsNull ==> \result != null;
- also
-
public exceptional_behavior
requires !(0 <= index&&index < this.theList.int_size());
assignable \nothing;
signals_only java.lang.ArrayIndexOutOfBoundsException;
- Specifications inherited from overridden method in class AbstractList:
pure- Specifications inherited from overridden method get(int index) in interface List:
pure -
public normal_behavior
requires 0 <= index&&index < this.size();
assignable \nothing;
ensures \result == this.theList.get(index);
- also
-
public exceptional_behavior
requires !(0 <= index&&index < this.size());
assignable \nothing;
signals_only java.lang.IndexOutOfBoundsException;
- implies_that
-
public normal_behavior
requires index >= 0;
ensures (\result == null)||\typeof(\result ) <: this.elementType;
ensures !this.containsNull ==> \result != null;
set
public Object set(int index,
Object element)
- Specified by:
set
in interface List
- Overrides:
set
in class AbstractList
- Specifications:
- also
-
public normal_behavior
requires 0 <= index&&index < this.theList.int_size();
requires element == null||\typeof(element) <: this.elementType;
requires this.containsNull||element != null;
assignable theCollection;
ensures this.theList.equals(\old(this.theList).replaceItemAt(index,element));
- also
-
public exceptional_behavior
requires !(0 <= index&&index < this.theList.int_size());
assignable \nothing;
signals_only java.lang.ArrayIndexOutOfBoundsException;
- Specifications inherited from overridden method set(int index, Object element) in class AbstractList:
- also
-
protected exceptional_behavior
requires \typeof(this) == \type(java.util.AbstractList);
assignable \nothing;
signals_only java.lang.UnsupportedOperationException;
- Specifications inherited from overridden method set(int index, Object element) in interface List:
-
public behavior
requires !this.containsNull ==> element != null;
requires (element == null)||\typeof(element) <: this.elementType;
{|-
requires 0 <= index&&index < this.size();
assignable theCollection;
ensures \result == (\old(this.theList.get(index)));
ensures this.theList.equals(\old(this.theList.subsequence(0,index)).insertBack(element).concat(\old(this.theList.subsequence(index+1,this.size()))));
signals_only java.lang.UnsupportedOperationException, java.lang.ClassCastException, java.lang.NullPointerException, java.lang.IllegalArgumentException;
signals (java.lang.UnsupportedOperationException) (* set method not supported by list *);
signals (java.lang.ClassCastException) (* class of specified element prevents it from being added to this *);
signals (java.lang.NullPointerException) (* element is null and null elements not supported by this *);
signals (java.lang.IllegalArgumentException) (* some aspect of element prevents it from being added to this *);
- also
-
requires !(0 <= index&&index < this.size());
assignable \nothing;
ensures false;
signals_only java.lang.UnsupportedOperationException, java.lang.IndexOutOfBoundsException;
- |}
add
public boolean add(nullable Object o)
- Specified by:
add
in interface List
- Overrides:
add
in class AbstractList
- Specifications:
- also
-
public normal_behavior
requires o == null||\typeof(o) <: this.elementType;
requires this.containsNull||o != null;
assignable theCollection;
ensures this.theList.equals(\old(this.theList).insertBack(o));
- Specifications inherited from overridden method add(Object o) in class AbstractList:
- also
-
protected model_program { ... }
- Specifications inherited from overridden method in class AbstractCollection:
--- None ---
- Specifications inherited from overridden method add(Object o) in interface List:
- also
-
public behavior
assignable theCollection;
ensures \result &&this.theList.equals(\old(this.theList).insertBack(o));
- Specifications inherited from overridden method add(Object o) in interface Collection:
-
public behavior
requires !this.containsNull ==> o != null;
requires (o == null)||\typeof(o) <: this.elementType;
assignable theCollection;
ensures \result ==> this.theCollection.equals(\old(this.theCollection.insert(o)));
ensures \result &&\old(this.size() < 2147483647) ==> this.size() == \old(this.size()+1);
ensures !\result ==> this.size() == \old(this.size());
ensures !\result ==> \not_modified(theCollection);
ensures this.contains(o);
ensures_redundantly !\result ==> \old(this.contains(o));
signals_only java.lang.UnsupportedOperationException, java.lang.NullPointerException, java.lang.ClassCastException, java.lang.IllegalArgumentException;
signals (java.lang.UnsupportedOperationException) (* this does not support add *);
signals (java.lang.NullPointerException) (* not allowed to add null *);
signals (java.lang.ClassCastException) (* class of specified element prevents it from being added to this *);
signals (java.lang.IllegalArgumentException) (* some aspect of this element prevents it from being added to this *);
remove
public boolean remove(nullable Object o)
- Specified by:
remove
in interface List
- Overrides:
remove
in class AbstractCollection
- Specifications:
- also
-
public normal_behavior
{|-
requires this.contains(o);
assignable theCollection;
ensures this.theList.equals(\old(this.theList).removeItemAt(\old(this.theList).indexOf(o)))&&\result ;
- also
-
requires !this.contains(o);
ensures !\result ;
- |}
- Specifications inherited from overridden method in class AbstractCollection:
--- None ---
- Specifications inherited from overridden method remove(Object o) in interface List:
- also
-
public behavior
assignable theCollection;
ensures \result ==> this.theList.equals(\old(this.theList.removeItemAt(this.theList.indexOf(o))));
- Specifications inherited from overridden method remove(Object o) in interface Collection:
-
public behavior
requires !this.containsNull ==> o != null;
requires (o == null)||\typeof(o) <: this.elementType;
assignable theCollection;
ensures \result ==> this.theCollection.equals(\old(this.theCollection.remove(o)));
ensures \result &&\old(this.size() <= 2147483647) ==> this.size() == \old(this.size()-1)&&this.size() < 2147483647&&this.size() >= 0;
ensures !\result ||\old(this.size() == 2147483647) ==> this.size() == \old(this.size());
signals_only java.lang.UnsupportedOperationException, java.lang.ClassCastException;
signals (java.lang.UnsupportedOperationException) (* this does not support remove *);
signals (java.lang.ClassCastException) (* the type of this element is not compatible with this *);
add
public void add(int index,
Object element)
- Specified by:
add
in interface List
- Overrides:
add
in class AbstractList
- Specifications:
- also
-
public normal_behavior
requires 0 <= index&&index < this.theList.int_size();
assignable theCollection;
ensures this.theList.equals(\old(this.theList).insertBeforeIndex(index,element));
- also
-
public normal_behavior
requires index == this.theList.int_size();
assignable theCollection;
ensures this.theList.equals(\old(this.theList).insertBack(element));
- also
-
public exceptional_behavior
requires !(0 <= index&&index <= this.theList.int_size());
assignable \nothing;
signals_only java.lang.ArrayIndexOutOfBoundsException;
- Specifications inherited from overridden method add(int index, Object element) in class AbstractList:
- also
-
protected exceptional_behavior
requires \typeof(this) == \type(java.util.AbstractList);
assignable \nothing;
signals_only java.lang.UnsupportedOperationException;
- Specifications inherited from overridden method add(int index, Object element) in interface List:
-
public behavior
requires !this.containsNull ==> element != null;
requires (element == null)||\typeof(element) <: this.elementType;
{|-
requires 0 <= index&&index <= this.size();
assignable theCollection;
ensures (element == null&&this.theList.get(index) == null)||(this.theList.get(index).equals(element))&&( \forall int i; 0 <= i&&i < index; (this.theList.get(i) == null&&\old(this.theList).get(i) == null)||this.theList.get(i).equals(\old(this.theList.get(i))))&&( \forall int i; index <= i&&i < \old(this.size()); (this.theList.get((int)(i+1)) == null&&\old(this.theList).get(i) == null)||this.theList.get((int)(i+1)).equals(\old(this.theList.get(i))));
signals_only java.lang.UnsupportedOperationException, java.lang.ClassCastException, java.lang.NullPointerException, java.lang.IllegalArgumentException;
signals (java.lang.UnsupportedOperationException) (* add method not supported by list *);
signals (java.lang.ClassCastException) (* class of specified element prevents it from being added to this *);
signals (java.lang.NullPointerException) (* element is null and null elements are not supported by this *);
signals (java.lang.IllegalArgumentException) (* some aspect of element prevents it from being added to this *);
- also
-
requires !(0 <= index&&index <= this.size());
assignable \nothing;
ensures false;
signals_only java.lang.UnsupportedOperationException, java.lang.IndexOutOfBoundsException;
- |}
remove
public Object remove(int index)
- Specified by:
remove
in interface List
- Overrides:
remove
in class AbstractList
- Specifications:
- also
-
public normal_behavior
requires 0 <= index&&index < this.theList.int_size();
assignable theCollection;
ensures this.theList.equals(\old(this.theList).removeItemAt(index));
- also
-
public exceptional_behavior
requires !(0 <= index&&index < this.theList.int_size());
assignable \nothing;
signals_only java.lang.ArrayIndexOutOfBoundsException;
- Specifications inherited from overridden method remove(int index) in class AbstractList:
- also
-
protected exceptional_behavior
requires \typeof(this) == \type(java.util.AbstractList);
assignable \nothing;
signals_only java.lang.UnsupportedOperationException;
- Specifications inherited from overridden method remove(int index) in interface List:
-
public behavior
{|-
requires 0 <= index&&index < this.size();
assignable theCollection;
ensures \result == (\old(this.theList.get(index)));
ensures ( \forall int i; 0 <= i&&i < index; (this.theList.get(i) == null&&\old(this.theList).get(i) == null)||this.theList.get(i) == (\old(this.theList.get(i))))&&( \forall \bigint i; index <= i&&i < (\old(this.size()-1)); (this.theList.get((int)i) == null&&\old(this.theList).get((int)(i+1)) == null)||this.theList.get((int)i) == (\old(this.theList.get((int)(i+1)))));
signals_only java.lang.UnsupportedOperationException;
signals (java.lang.UnsupportedOperationException) (* remove method not supported by list *);
- also
-
requires 0 <= index&&index < this.size();
assignable theCollection;
ensures (\result == null)||\typeof(\result ) <: this.elementType;
ensures !this.containsNull ==> \result != null;
- also
-
requires !(0 <= index&&index < this.size());
assignable \nothing;
ensures false;
signals_only java.lang.UnsupportedOperationException, java.lang.IndexOutOfBoundsException;
- |}
clear
public void clear()
- Specified by:
clear
in interface List
- Overrides:
clear
in class AbstractList
- Specifications:
- also
-
public normal_behavior
assignable theCollection;
ensures this.theList.isEmpty();
- Specifications inherited from overridden method in class AbstractList:
- also
-
protected model_program { ... }
- Specifications inherited from overridden method in class AbstractCollection:
--- None ---
- Specifications inherited from overridden method in interface List:
--- None ---
- Specifications inherited from overridden method in interface Collection:
-
public behavior
assignable theCollection;
ensures this.theCollection.isEmpty();
ensures_redundantly this.size() == 0;
signals_only java.lang.UnsupportedOperationException;
signals (java.lang.UnsupportedOperationException) (* clear is not supported by this *);
containsAll
public boolean containsAll(Collection c)
- Specified by:
containsAll
in interface List
- Overrides:
containsAll
in class AbstractCollection
- Specifications: pure
- Specifications inherited from overridden method in class AbstractCollection:
pure- Specifications inherited from overridden method in interface List:
pure- Specifications inherited from overridden method containsAll(Collection c) in interface Collection:
pure -
public behavior
requires c != null;
requires c.elementType <: this.elementType;
requires !this.containsNull ==> !c.containsNull;
assignable \nothing;
ensures \result <==> ( \forall java.lang.Object o; ; c.contains(o) ==> this.contains(o));
ensures \result <==> this.theCollection.containsAll(c);
signals_only java.lang.ClassCastException, java.lang.NullPointerException;
signals (java.lang.ClassCastException) (* class of specified element prevents it from being added to 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;
addAll
public boolean addAll(Collection c)
- Specified by:
addAll
in interface List
- Overrides:
addAll
in class AbstractCollection
- Specifications inherited from overridden method in class AbstractCollection:
--- None ---
- Specifications inherited from overridden method in interface List:
--- None ---
- Specifications inherited from overridden method addAll(Collection c) in interface Collection:
-
public behavior
requires c != null;
requires c.elementType <: this.elementType;
requires !this.containsNull ==> !c.containsNull;
assignable theCollection;
ensures this.theCollection.equals(\old(this.theCollection).union(c.theCollection));
signals_only java.lang.UnsupportedOperationException, java.lang.ClassCastException, java.lang.IllegalArgumentException, java.lang.NullPointerException;
signals (java.lang.UnsupportedOperationException) (* this does not support addAll *);
signals (java.lang.ClassCastException) (* class of specified element prevents it from being added to this *);
signals (java.lang.IllegalArgumentException) (* some aspect of this element prevents it from being added to 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;
removeAll
public boolean removeAll(Collection c)
- Specified by:
removeAll
in interface List
- Overrides:
removeAll
in class AbstractCollection
- Specifications inherited from overridden method in class AbstractCollection:
--- None ---
- Specifications inherited from overridden method in interface List:
--- None ---
- 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;
retainAll
public boolean retainAll(Collection c)
- Specified by:
retainAll
in interface List
- Overrides:
retainAll
in class AbstractCollection
- Specifications inherited from overridden method in class AbstractCollection:
--- None ---
- Specifications inherited from overridden method in interface List:
--- None ---
- Specifications inherited from overridden method retainAll(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).intersection(c.theCollection));
signals_only java.lang.UnsupportedOperationException, java.lang.ClassCastException, java.lang.NullPointerException;
signals (java.lang.UnsupportedOperationException) (* this does not support retainAll *);
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;
addAll
public boolean addAll(int index,
Collection c)
- Specified by:
addAll
in interface List
- Overrides:
addAll
in class AbstractList
- Specifications inherited from overridden method in class AbstractList:
--- None ---
- Specifications inherited from overridden method addAll(int index, Collection c) in interface List:
-
public behavior
requires c != null;
requires 0 <= index&&index <= this.size();
requires c.elementType <: this.elementType;
requires !this.containsNull ==> !c.containsNull;
assignable theCollection;
ensures \result ==> this.theList.equals(\old(this.theList.subsequence(0,index)).concat(org.jmlspecs.models.JMLEqualsSequence.convertFrom(c)).concat(\old(this.theList.subsequence(index,this.size()))));
signals_only java.lang.UnsupportedOperationException, java.lang.IllegalArgumentException;
signals (java.lang.UnsupportedOperationException) (* if this operation is not supported *);
signals (java.lang.IllegalArgumentException) (* if some aspect of c prevents its elements from being added to the list *);
- also
-
public exceptional_behavior
requires c == null||!(0 <= index&&index <= this.size())||!(c.elementType <: this.elementType)||(!this.containsNull&&c.containsNull);
assignable \nothing;
signals_only java.lang.UnsupportedOperationException, java.lang.ClassCastException, java.lang.NullPointerException, java.lang.IndexOutOfBoundsException;
signals (java.lang.ClassCastException) c != null&&!(c.elementType <: this.elementType);
signals (java.lang.NullPointerException) c == null;
signals (java.lang.IndexOutOfBoundsException) !(0 <= index&&index <= this.size());
equals
public boolean equals(nullable Object o)
- Specified by:
equals
in interface List
- Overrides:
equals
in class AbstractList
- Specifications: pure
- Specifications inherited from overridden method in class AbstractList:
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 List:
pure- also
-
public normal_behavior
requires o instanceof java.util.List&&this.size() == ((java.util.List)o).size();
assignable \nothing;
ensures \result ==> ( \forall int i; 0 <= i&&i < this.size(); (this.theList.get(i) == null&&((java.util.List)o).theList.get(i) == null)||(this.theList.get(i).equals(((java.util.List)o).theList.get(i))));
- also
-
public normal_behavior
requires !(o instanceof java.util.List&&this.size() == ((java.util.List)o).size());
assignable \nothing;
ensures !\result ;
- Specifications inherited from overridden method in interface Collection:
--- None ---
hashCode
public int hashCode()
- Specified by:
hashCode
in interface List
- Overrides:
hashCode
in class AbstractList
- Specifications: pure
- Specifications inherited from overridden method in class AbstractList:
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 List:
--- None ---
- Specifications inherited from overridden method in interface Collection:
--- None ---
toString
public String toString()
- Overrides:
toString
in class AbstractCollection
- Specifications:
- also
-
public normal_behavior
assignable \nothing;
ensures (* \result is a string representation of this Vector *);
- Specifications inherited from overridden method in class AbstractCollection:
--- None ---
- Specifications inherited from overridden method in class Object:
non_null -
public normal_behavior
assignable objectState;
ensures \result != null&&\result .equals(this.theString);
ensures (* \result is a string representation of this object *);
- also
-
public code normal_behavior
assignable \nothing;
ensures \result != null&&(* \result is the instance's class name, followed by an @, followed by the instance's hashcode in hex *);
- also
-
public code model_program { ... }
- implies_that
-
assignable objectState;
ensures \result != null;
subList
public List subList(int fromIndex,
int toIndex)
- Specified by:
subList
in interface List
- Overrides:
subList
in class AbstractList
- Specifications: pure
- Specifications inherited from overridden method in class AbstractList:
pure- Specifications inherited from overridden method subList(int fromIndex, int toIndex) in interface List:
pure -
public normal_behavior
requires 0 <= fromIndex&&fromIndex <= this.size()&&0 <= toIndex&&toIndex <= this.size()&&fromIndex <= toIndex;
assignable \nothing;
ensures \result != null&&\result .theList.equals(this.theList.subsequence(fromIndex,toIndex));
- also
-
public exceptional_behavior
requires !(0 <= fromIndex&&fromIndex <= this.size())||!(0 <= toIndex&&toIndex <= this.size())||!(fromIndex <= toIndex);
assignable \nothing;
signals_only java.lang.IndexOutOfBoundsException;
- implies_that
-
public normal_behavior
requires 0 <= fromIndex&&fromIndex <= toIndex;
removeRange
protected void removeRange(int fromIndex,
int toIndex)
- Overrides:
removeRange
in class AbstractList
- Specifications inherited from overridden method removeRange(int fromIndex, int toIndex) in class AbstractList:
-
protected normal_behavior
requires 0 <= fromIndex&&fromIndex <= toIndex&&toIndex <= this.size();
{|-
requires fromIndex == toIndex;
assignable \nothing;
- also
-
requires fromIndex < toIndex&&toIndex < this.size();
assignable theCollection;
ensures this.theList.equals(\old(this.theList.subsequence(0,fromIndex).concat(this.theList.subsequence(toIndex,this.size()))));
- |}
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.