01: // @(#)$Id: JMLObjectType.java 1.1.1.1 Mon, 09 May 2005 15:27:50 +0200 engelc $
02:
03: // Copyright (C) 1998, 1999 Iowa State University
04:
05: // This file is part of JML
06:
07: // JML is free software; you can redistribute it and/or modify
08: // it under the terms of the GNU General Public License as published by
09: // the Free Software Foundation; either version 2, or (at your option)
10: // any later version.
11:
12: // JML is distributed in the hope that it will be useful,
13: // but WITHOUT ANY WARRANTY; without even the implied warranty of
14: // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15: // GNU General Public License for more details.
16:
17: // You should have received a copy of the GNU General Public License
18: // along with JML; see the file COPYING. If not, write to
19: // the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
20:
21: package org.jmlspecs.models;
22:
23: /** Objects that are containers of object references.
24: * It is the intention that classes that implement JMLObjectType be
25: * "containers of objects", in the sense that the user is only
26: * interested in the "object references", (addresses) themselves
27: * as the elements in the container. (This is in opposition to
28: * the intention of classes that implement JMLValueType.) With
29: * object containers, the object references are copied in operations
30: * that create new instances of the container classes, e.g., clone().
31: * So there is no "deep copy" made with classes that implement
32: * JMLObjectType.
33: *
34: * @version $Revision: 1.1.1.1 $
35: * @author Gary T. Leavens
36: * @author Albert L. Baker
37: * @see JMLType
38: */
39: //-@ immutable
40: public interface JMLObjectType extends JMLType {
41:
42: /** Return a shallow copy of this object.
43: */
44: /*@ also
45: @ public normal_behavior
46: @ ensures \result instanceof JMLObjectType;
47: @*/
48: public/*@ pure @*/Object clone();
49:
50: /** Tell whether this object is equal to the argument, using ==
51: * for comparisons to compare contained objects.
52: */
53: /*@ also
54: @ public normal_behavior
55: @ ensures \result ==>
56: @ ob2 != null;
57: @*/
58: public/*@ pure @*/boolean equals(Object ob2);
59: }
|