pnuts.lang
Interface Numeric


public interface Numeric

In Pnuts, arithmetic operations for objects implements this interface causes a call of the corresponding methods in this interface. See Pnuts Language Specification for details.

Version:
1.1
Author:
Toyokazu Tomatsu

Field Summary
static int EQUAL
           
static int LEFT_IS_BIGGER
           
static int NOT_EQUAL
           
static int RIGHT_IS_BIGGER
           
 
Method Summary
 java.lang.Object add(java.lang.Object obj)
          Adds the value of parameter to itself
 int compareTo(java.lang.Object o)
          Compares the object with the parameter.
 java.lang.Object divide(java.lang.Object obj)
          Divides itself by the value of parameter
 java.lang.Object inverse()
          Inverts itself
 java.lang.Object multiply(java.lang.Object o)
          Multiplies itself with the value of parameter
 java.lang.Object negate()
          Negates itself by the value of parameter
 java.lang.Object subtract(java.lang.Object obj)
          Subtracts the value of parameter from the object
 

Field Detail

NOT_EQUAL

static final int NOT_EQUAL
See Also:
Constant Field Values

LEFT_IS_BIGGER

static final int LEFT_IS_BIGGER
See Also:
Constant Field Values

RIGHT_IS_BIGGER

static final int RIGHT_IS_BIGGER
See Also:
Constant Field Values

EQUAL

static final int EQUAL
See Also:
Constant Field Values
Method Detail

add

java.lang.Object add(java.lang.Object obj)
Adds the value of parameter to itself


subtract

java.lang.Object subtract(java.lang.Object obj)
Subtracts the value of parameter from the object


multiply

java.lang.Object multiply(java.lang.Object o)
Multiplies itself with the value of parameter


divide

java.lang.Object divide(java.lang.Object obj)
Divides itself by the value of parameter


negate

java.lang.Object negate()
Negates itself by the value of parameter


inverse

java.lang.Object inverse()
Inverts itself


compareTo

int compareTo(java.lang.Object o)
Compares the object with the parameter. returns one of the followings: NOT_EQUAL, LEFT_IS_BIGGER, RIGHT_IS_BIGGER, EQUAL