JML

org.jmlspecs.models
Class JMLShort

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

public class JMLShort
extends Object
implements JMLComparable

A reflection of Short that implements JMLType.

Version:
$Revision: 1.27 $
Author:
Gary T. Leavens, Brandon Shilling
See Also:
Short, JMLChar, JMLByte, JMLInteger, JMLLong, JMLType

Field Summary
static JMLShort ONE
          The JMLShort that represents one.
private  short shortValue
          The short value of this object.
static JMLShort ZERO
          The JMLShort that represents zero.
 
Constructor Summary
JMLShort()
          Initialize this object to 0.
JMLShort(Short inShort)
          Initialize this object to the given short.
JMLShort(String s)
          Initialize this object to the given short.
JMLShort(short inShort)
          Initialize this object to the given short.
 
Method Summary
 Object clone()
          Return a clone of this object.
 int compareTo(Object op2)
          Compare this to op2, returning a comparison code.
 JMLShort dividedBy(JMLShort i2)
          Return a new object containing the quotient of this object's short value divided by that of the given argument.
 boolean equals(Object op2)
          Test whether this object's value is equal to the given argument.
 Short getShort()
          Return an Short object containing the short value in this object.
 boolean greaterThan(JMLShort i2)
          Tell whether this object's short value is strictly greater than that of the given argument.
 boolean greaterThanOrEqualTo(JMLShort i2)
          Tell whether this object's short value is greater than or equal to that of the given argument.
 int hashCode()
          Return a hash code for this object.
 boolean lessThan(JMLShort i2)
          Tell whether this object's short value is strictly less than that of the given argument.
 boolean lessThanOrEqualTo(JMLShort i2)
          Tell whether this object's short value is less than or equal to that of the given argument.
 JMLShort minus(JMLShort i2)
          Return a new object containing the difference between this object's short value and that of the given argument.
 JMLShort negated()
          Return a new object containing the negation of this object's short value.
 JMLShort plus(JMLShort i2)
          Return a new object containing the sum of this object's short value and that of the given argument.
 JMLShort remainderBy(JMLShort i2)
          Return a new object containing the remainder of this object's short value divided by that of the given argument.
 short shortValue()
          Return the short value in this object.
 JMLShort times(JMLShort i2)
          Return a new object containing the product of this object's short 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

shortValue

private short shortValue
The short value of this object.


ZERO

public static final JMLShort ZERO
The JMLShort that represents zero.


ONE

public static final JMLShort ONE
The JMLShort that represents one.

Constructor Detail

JMLShort

public JMLShort()
Initialize this object to 0.


JMLShort

public JMLShort(short inShort)
Initialize this object to the given short.


JMLShort

public JMLShort(Short inShort)
Initialize this object to the given short.

Parameters:
inShort - an object containing the value to use.

JMLShort

public JMLShort(String s)
         throws JMLTypeException
Initialize this object to the given short.

Parameters:
s - a string that contains the decimal representation of the desired value.
Throws:
JMLTypeException
Method Detail

clone

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

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

compareTo

public int compareTo(Object op2)
              throws 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 JMLShort.

equals

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

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

hashCode

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

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

shortValue

public short shortValue()
Return the short value in this object.


getShort

public Short getShort()
Return an Short object containing the short value in this object.


negated

public JMLShort negated()
Return a new object containing the negation of this object's short value.


plus

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


minus

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


times

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


dividedBy

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


remainderBy

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


greaterThan

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


lessThan

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


greaterThanOrEqualTo

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


lessThanOrEqualTo

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


toString

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

Overrides:
toString in class Object

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.