JML

org.jmlspecs.models
Class JMLChar

java.lang.Object
  extended byorg.jmlspecs.models.JMLChar
All Implemented Interfaces:
Cloneable, Comparable, JMLComparable, JMLType, Serializable

public class JMLChar
extends Object
implements JMLComparable

A reflection of Character that implements JMLType.

Version:
$Revision: 1.26 $
Author:
Curtis Clifton with extensive input from the JML Seminar at Iowa State University, June-July 1999., Gary T. Leavens
See Also:
Character, JMLByte, JMLShort, JMLInteger, JMLLong, JMLString, JMLType

Field Summary
protected  char value
          The character that is the abstract value of this object.
static JMLChar ZERO
          The JMLChar that represents zero.
 
Constructor Summary
JMLChar()
          Initialize this to contain the null character.
JMLChar(char c)
          Initialize this to contain the given character.
JMLChar(Character inChar)
          Initialize this to contain the character contained in the given Character.
 
Method Summary
 char charValue()
          Return the character contained in this object.
 Object clone()
          Return a clone of this object.
 int compareTo(Object op2)
          Compare this to op2, returning a comparison code.
 JMLChar dividedBy(JMLChar i2)
          Return a new object containing the quotient of this object's char value divided by that of the given argument.
 boolean equals(Object obj)
          Test whether this object's value is equal to the given argument.
 Character getChar()
          Return a Character object containing this object's character.
 boolean greaterThan(JMLChar i2)
          Tell whether this this object's char value is strictly greater than that of the given argument.
 boolean greaterThanOrEqualTo(JMLChar i2)
          Tell whether this this object's char value is greater than or equal to that of the given argument.
 int hashCode()
          Return a hash code for this object.
 int intValue()
          Return the integer corresponding to this character.
 boolean lessThan(JMLChar i2)
          Tell whether this this object's char value is strictly less than that of the given argument.
 boolean lessThanOrEqualTo(JMLChar i2)
          Tell whether this this object's char value is less than or equal to that of the given argument.
 JMLChar minus(JMLChar i2)
          Return a new object containing the difference between of this object's char value and that of the given argument.
 JMLChar plus(JMLChar i2)
          Return a new object containing the sum of this object's char value and that of the given argument.
 JMLChar remainderBy(JMLChar i2)
          Return a new object containing the remainder of this object's char value divided by that of the given argument.
 JMLChar times(JMLChar i2)
          Return a new object containing the product of this object's char value and that of the given argument.
 String toString()
          Return a string representation of this object.
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

value

protected final char value
The character that is the abstract value of this object.


ZERO

public static final JMLChar ZERO
The JMLChar that represents zero.

Constructor Detail

JMLChar

public JMLChar()
Initialize this to contain the null character.


JMLChar

public JMLChar(char c)
Initialize this to contain the given character.


JMLChar

public JMLChar(Character inChar)
Initialize this to contain the character contained in the given Character.

Method Detail

clone

public Object clone()
Return a clone of this object.

Specified by:
clone in interface JMLType
Overrides:
clone in class Object

charValue

public char charValue()
Return the character contained in this object.


getChar

public Character getChar()
Return a Character object containing this object's character.


hashCode

public int hashCode()
Return a hash code for this object.

Specified by:
hashCode in interface JMLType
Overrides:
hashCode in class Object

compareTo

public int compareTo(Object op2)
              throws NullPointerException,
                     ClassCastException
Compare this to op2, returning a comparison code.

Specified by:
compareTo in interface JMLComparable
Parameters:
op2 - the object this is compared to.
Throws:
ClassCastException - when o is not a JMLChar.
NullPointerException

equals

public boolean equals(Object obj)
Test whether this object's value is equal to the given argument.

Specified by:
equals in interface JMLType
Overrides:
equals in class Object

toString

public String toString()
Return a string representation of this object.

Overrides:
toString in class Object

intValue

public int intValue()
Return the integer corresponding to this character.


plus

public JMLChar plus(JMLChar i2)
Return a new object containing the sum of this object's char value and that of the given argument.


minus

public JMLChar minus(JMLChar i2)
Return a new object containing the difference between of this object's char value and that of the given argument.


times

public JMLChar times(JMLChar i2)
Return a new object containing the product of this object's char value and that of the given argument.


dividedBy

public JMLChar dividedBy(JMLChar i2)
Return a new object containing the quotient of this object's char value divided by that of the given argument.


remainderBy

public JMLChar remainderBy(JMLChar i2)
Return a new object containing the remainder of this object's char value divided by that of the given argument.


greaterThan

public boolean greaterThan(JMLChar i2)
Tell whether this this object's char value is strictly greater than that of the given argument.


lessThan

public boolean lessThan(JMLChar i2)
Tell whether this this object's char value is strictly less than that of the given argument.


greaterThanOrEqualTo

public boolean greaterThanOrEqualTo(JMLChar i2)
Tell whether this this object's char value is greater than or equal to that of the given argument.


lessThanOrEqualTo

public boolean lessThanOrEqualTo(JMLChar i2)
Tell whether this this object's char value is less than or equal to that of the given argument.


JML

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.