Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members  

Multiplier Class Reference

Inheritance diagram for Multiplier::

Function2 List of all members.

Public Methods

Object apply (Object x, Object y)

Static Public Methods

Number multiply (Object x, Object y)

Detailed Description

A Multiplier is a Function2 object that can be used to multiply a pair of Numbers. If both Numbers are Long or Integer, it returns a Long. Otherwise it returns a Double.

Definition at line 11 of file Multiplier.java.


Member Function Documentation

Object Multiplier::apply ( Object x,
Object y ) [inline]
 

Apply this Multiplier object to two Objects, both of which should be Numbers. If they are not numbers, a ClassCastException will be thrown.

Parameters:
x   the first argument of this function
y   the second argument of this function
Returns:
a Number containing the product of the arguments. If the arguments are both Integer or Long, it returns a Long. Otherwise it returns a Double.

Reimplemented from Function2.

Definition at line 33 of file Multiplier.java.

Number Multiplier::multiply ( Object x,
Object y ) [inline, static]
 

Multiply two Objects, both of which should be Numbers. If they are not numbers, a ClassCastException will be thrown.

Parameters:
x   the first argument of this function
y   the second argument of this function
Returns:
a Number containing the product of the arguments. If the arguments are both Integer or Long, it returns a Long. Otherwise it returns a Double.

Definition at line 49 of file Multiplier.java.


The documentation for this class was generated from the following file:
Generated at Wed Feb 19 23:28:37 2003 for OpenList by doxygen1.2.6 written by Dimitri van Heesch, © 1997-2001