// @(#)$Id: JMLDataGroup.refines-java 1287 2005-03-01 02:58:57Z cok $

// 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.


package org.jmlspecs.lang;

/** A type with one element, for use in declaring "data groups".
 *  Note that there is only one equivalence class of objects of this type;
 *  that is, all objects of this type are considered .equal to each other.
 *
 * @version $Revision: 1287 $
 * @author Gary T. Leavens, based on an idea of Rustan Leino
 */
public /*@ pure @*/ final class JMLDataGroup {

    /*@ private normal_behavior
      @   assignable owner;
      @   ensures owner == null;
      @*/
    private JMLDataGroup();

    /** The only object of this type.
     */
    public static final /*@ non_null @*/ JMLDataGroup IT; 

    /** Return this object.
     */
    //@ also
    //@ ensures \result == this;
    //@ signals (Exception) false;
    public Object clone();

    /** Test whether the given argument is a non-null object of type
     *  JMLDataGroup.
     */
    /*@ also
      @   public normal_behavior
      @     ensures \result <==> oth != null && oth instanceof JMLDataGroup;
      @*/
    public boolean equals(Object oth);
    
    /** Return a hash code for this object.
     */
    public /*@ pure @*/ int hashCode();

    /** Return a string representation of this object.
     */
    /*@ also
      @   public normal_behavior
      @     ensures \result != null
      @          && (* result is a string representation of this *);
      @*/
    public String toString();
    
}
