// @(#) $Id: SLList.refines-jml,v 1.9 2005/12/24 21:20:31 chalin Exp $ // Copyright (C) 1998, 1999 Iowa State University // This file is part of JML // JML is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2, or (at your option) // any later version. // JML is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License // along with JML; see the file COPYING. If not, write to // the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. // Author: Clyde Ruby package org.jmlspecs.samples.list.list1; //@ refine "SLList.java"; import org.jmlspecs.samples.list.list1.node.SLNode; //@ model import org.jmlspecs.models.JMLObjectSequence; // FIXME: adapt this file to non-null-by-default and remove the following modifier. /*@ nullable_by_default @*/ public class SLList { /*@ also @ protected code normal_behavior @ requires \same; @ accessible \nothing; @ captures \nothing; @ callable new SLNode(Object); @*/ public SLList(); /*@ also @ protected code normal_behavior @ requires \same; @ accessible theListNode_; @ captures \nothing; @ callable SLNode.getNextNode(); @*/ public void firstEntry(); /*@ also @ protected code normal_behavior @ requires \same; @ accessible cursorNode_; @ captures \nothing; @ callable isOffEnd(), SLNode.getNextNode(); @*/ public void incrementCursor(); /*@ also @ protected code normal_behavior @ requires \same; @ captures \nothing; @ accessible theListNode_; @ callable \nothing; @*/ public /*@ pure @*/ boolean isOffFront(); /*@ also @ protected code normal_behavior @ requires \same; @ accessible cursorNode_; @ captures \nothing; @ callable \nothing; @*/ public /*@ pure @*/ boolean isOffEnd(); /*@ also @ protected code normal_behavior @ requires \same; @ accessible cursorNode_; @ captures \nothing; @ callable isOffEnd(), isOffFront(), SLNode.getEntry(); @*/ public /*@ pure @*/ Object getEntry(); /*@ also @ protected code normal_behavior @ requires \same; @ accessible cursorNode_; @ captures \nothing; @ callable isOffEnd(), isOffFront(), decreaseCursor(), @ SLNode.removeNextNode(); @*/ public void removeEntry(); /*@ also @ protected code normal_behavior @ requires \same; @ accessible cursorNode_, newEntry; @ captures newEntry; @ callable SLNode.setEntry(Object); @*/ public void replaceEntry(Object newEntry); /*@ also @ protected code normal_behavior @ requires \same; @ accessible cursorNode_; @ captures newEntry; @ callable isOffEnd(), SLNode.insertAfter(Object); @*/ public void insertAfterCursor(Object newEntry); /*@ also @ protected code normal_behavior @ requires \same; @ accessible \nothing; @ captures newEntry; @ callable isOffFront(), decreaseCursor(), @ insertAfterCursor(Object), incrementCursor(); @*/ public void insertBeforeCursor(Object newEntry); /*@ also @ protected code normal_behavior @ requires \same; @ accessible this; @ captures theListNode_.entries; @ callable new SLList(SLNode ); @*/ public /*@ non_null @*/ Object clone(); /*@ also @ protected code normal_behavior @ requires \same; @ accessible cursorNode_, theListNode_; @ captures \nothing; @ callable isOffFront(), firstEntry(), isOffEnd(), incrementCursor(); @*/ protected void decreaseCursor(); /*@ also @ protected code normal_behavior @ requires \same; @ accessible theListNode_, othLst.theListNode_; @ captures othLst.theListNode_.entries; @ callable firstEntry(), othLst.theListNode_.clone(); @*/ protected SLList(SLList othLst); /*@ also @ protected code normal_behavior @ requires \same; @ accessible theListNode_; @ captures listNode.entries; @ callable firstEntry(), listNode.clone(); @*/ protected SLList(SLNode listNode); }