Class Operator

java.lang.Object
  extended byOperator
All Implemented Interfaces:
java.lang.Comparable
Direct Known Subclasses:
BinaryOperator, UnaryOperator

public class Operator
extends java.lang.Object
implements java.lang.Comparable

Cette est la classe de base pour les operateurs

Author:
Tachouct Mustapha

Field Summary
(package private) static BinaryOperator ADD
           
(package private) static BinaryOperator DIV
           
(package private) static BinaryOperator MUL
           
(package private) static UnaryOperator NEG
           
(package private)  char op
           
(package private) static BinaryOperator POW
           
(package private) static BinaryOperator SUB
           
 
Constructor Summary
(package private) Operator(char c)
           
(package private) Operator(java.lang.String str)
           
 
Method Summary
 int compareTo(java.lang.Object o)
           
static double compute(BinaryOperator op, double a, double b)
           
static java.lang.Double compute(BinaryOperator op, java.lang.Double a, java.lang.Double b)
           
static double compute(UnaryOperator op, double a)
           
static java.lang.Double compute(UnaryOperator op, java.lang.Double a)
           
static void main(java.lang.String[] args)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ADD

static final BinaryOperator ADD

SUB

static final BinaryOperator SUB

DIV

static final BinaryOperator DIV

POW

static final BinaryOperator POW

MUL

static final BinaryOperator MUL

NEG

static final UnaryOperator NEG

op

char op
Constructor Detail

Operator

Operator(char c)

Operator

Operator(java.lang.String str)
Method Detail

compareTo

public int compareTo(java.lang.Object o)
Specified by:
compareTo in interface java.lang.Comparable

toString

public java.lang.String toString()

main

public static void main(java.lang.String[] args)

compute

public static double compute(UnaryOperator op,
                             double a)

compute

public static double compute(BinaryOperator op,
                             double a,
                             double b)

compute

public static java.lang.Double compute(UnaryOperator op,
                                       java.lang.Double a)

compute

public static java.lang.Double compute(BinaryOperator op,
                                       java.lang.Double a,
                                       java.lang.Double b)