org.jmlspecs.samples.list.node2
Class OneWayNode
java.lang.Object
org.jmlspecs.samples.list.node2.OneWayNode
- Direct Known Subclasses:
- TwoWayNode
- public class OneWayNode
- extends Object
Class Specifications |
protected invariant_redundantly this.nextLink_ != null;
protected invariant this.nextNode_ == this.nextLink_.node;
public invariant_redundantly this.entries != null&&this.allButFirst != null;
public invariant this.entries.equals(this.allButFirst.insertFront(this.theEntry));
protected represents theEntry <- this.entry_;
protected represents nextNode <- this.nextNode_;
protected represents entries <- this.allButFirst.insertFront(this.entry_);
protected represents allButFirst <- (this.nextNode_ == null) ? new org.jmlspecs.models.JMLObjectSequence() : this.nextNode_.entries; |
Specifications inherited from class Object |
represents objectState <- org.jmlspecs.lang.JMLDataGroup.IT;
public represents _getClass <- \typeof(this); |
entries
public JMLObjectSequence entries
- Specifications: non_null
datagroup contains: allButFirst theEntry entry_ nextNode_.entries org.jmlspecs.samples.list.node2.TwoWayNode.prevEntries
allButFirst
public JMLObjectSequence allButFirst
- Specifications: non_null
is in groups: entries
datagroup contains: nextNode nextNode_.entries nextNode_.allButFirst
theEntry
public Object theEntry
- Specifications: nullable
is in groups: entries
datagroup contains: entry_
nextNode
public OneWayNode nextNode
- Specifications: nullable
is in groups: allButFirst
datagroup contains: nextNode_ nextLink_ org.jmlspecs.samples.list.node2.TwoWayNode.nextDL
entry_
protected Object entry_
- Specifications: nullable
is in groups: theEntry entries
nextNode_
protected OneWayNode nextNode_
- Specifications: nullable
is in groups: nextNode
maps nextNode_.entries \into entries allButFirst, nextNode_.allButFirst \into allButFirst
nextLink_
protected Link nextLink_
- Specifications: nullable
is in groups: nextNode
OneWayNode
protected OneWayNode()
OneWayNode
public OneWayNode(nullable Object ent)
- Specifications:
-
public normal_behavior
assignable entries;
ensures this.theEntry == ent&&this.entries.int_size() == 1&&this.entries.itemAt(0) == ent&&this.allButFirst.isEmpty();
OneWayNode
public OneWayNode(nullable Object ent,
nullable OneWayNode nxtNode)
- Specifications:
-
public normal_behavior
assignable entries;
ensures this.theEntry == ent&&this.entries.itemAt(0) == ent&&this.nextNode == nxtNode;
getEntry
public Object getEntry()
- Specifications: pure nullable
-
public normal_behavior
assignable \nothing;
ensures \result == this.theEntry;
setEntry
public void setEntry(nullable Object newEntry)
- Specifications:
-
public normal_behavior
assignable theEntry;
ensures this.theEntry == newEntry&&this.entries.itemAt(0) == newEntry;
getNextNode
public OneWayNode getNextNode()
- Specifications: nullable
-
protected normal_behavior
assignable \nothing;
ensures \result == this.nextNode;
getNextLink
public Link getNextLink()
- Specifications: pure nullable
-
public normal_behavior
assignable \nothing;
ensures \result .node == this.nextNode;
insertAfter
public void insertAfter(nullable Object newEntry)
- Specifications:
-
public normal_behavior
assignable allButFirst;
ensures this.allButFirst.equals(\old(this.allButFirst).insertFront(newEntry));
removeNextNode
public void removeNextNode()
- Specifications:
-
public normal_behavior
requires !this.allButFirst.isEmpty();
assignable allButFirst;
ensures this.allButFirst.equals(\old(this.allButFirst).trailer());
- also
-
requires this.allButFirst.isEmpty();
assignable \nothing;
ensures this.allButFirst.isEmpty();
hasNext
public boolean hasNext()
- Specifications:
-
public normal_behavior
assignable \nothing;
ensures \result == (this.nextNode != null);
toString
public String toString()
- Overrides:
toString
in class Object
- Specifications: pure non_null
- Specifications inherited from overridden method in class Object:
non_null -
public normal_behavior
assignable objectState;
ensures \result != null;
ensures \result == 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;
stringOfEntries
protected String stringOfEntries(nullable OneWayNode curr)
- Specifications: pure 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.