hussam.math.operations.dataBase
Class OperatorFactoryDB

java.lang.Object
extended by hussam.math.operations.dataBase.OperatorSourceImpl
extended by hussam.math.operations.dataBase.OperatorFactoryDB
All Implemented Interfaces:
OperatorSource

public class OperatorFactoryDB
extends OperatorSourceImpl

This is the default DataSource. It contains most used operands and Functions. If you wanted to add new Functions of Operands and make them public for every one, use this class direclty. other wise, wrap this DataSource using OperatorSourceWrapper to have a different context.

To get the DataSource use:
 OperatorSource source = OperatorSourceDB.getInstance();
as you can notice there is only one instance from this class.
You can also notice the inner operand classes, you can use them directly,
 however, it is always preferable to use getOperand()

Author:
Hussam Almulhim حسام الملحم
See Also:
OperatorSourceWrapper

Nested Class Summary
static classOperatorFactoryDB.CommaOperand
          This class was used in previous Versions of the ExpressionReader implementations.
 
Field Summary
static intFALSE
          a flag indicating that the result of a logical operation is false value.
static java.lang.StringPACKAGE_AUTHOR
          This is the name of the Author of the package.
static java.lang.StringPACKAGE_NAME
          This is the package name.
static java.lang.StringPACKAGE_VERSION
          This is the Package Version Number.
static intTRUE
          a flag indicating that the result of the logical operation is a true value.
 
Method Summary
 java.util.Map<java.lang.String,OperatorFactory<? extends Operator>>getAllFactories()
          Returns all Factories combined.
 OperatorFactory<Function>getFunctionFactory(java.lang.String name)
          Returns the FunctionFactory for the given Function name.
 java.util.List<OperatorFactory<Function>>getFunctions()
           
static OperatorSourceImplgetInstance()
          Returns the sole instance of this DataSource.
 OperandgetOperand(java.lang.String name)
           
 OperatorFactory<Operand>getOperandFactory(java.lang.String name)
          Returns the factory for the given Operand.
 java.util.List<OperatorFactory<Operand>>getOperands()
           
static voidmain(java.lang.String[] args)
          A test Method.
 
Methods inherited from class hussam.math.operations.dataBase.OperatorSourceImpl
addFunction, addFunctions, addGlobalVariable, addGlobalVariables, addLocalVariable, addLocalVariables, addOperand, addOperands, getFunctionFactories, getGlobalVariable, getGlobalVariables, getLocalVariable, getLocalVariables, getOperandFactories, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

TRUE

public static final int TRUE
a flag indicating that the result of the logical operation is a true value.

See Also:
Constant Field Values

FALSE

public static final int FALSE
a flag indicating that the result of a logical operation is false value.

See Also:
Constant Field Values

PACKAGE_AUTHOR

public static final java.lang.String PACKAGE_AUTHOR
This is the name of the Author of the package. Which is Hussam AlMulhim حسام الملحم 9 Sh3ban 1426 12 Sept 2005

See Also:
Constant Field Values

PACKAGE_NAME

public static final java.lang.String PACKAGE_NAME
This is the package name. Which is Math Parser.

See Also:
Constant Field Values

PACKAGE_VERSION

public static final java.lang.String PACKAGE_VERSION
This is the Package Version Number.

See Also:
Constant Field Values
Method Detail

getOperands

public java.util.List<OperatorFactory<Operand>> getOperands()

getFunctions

public java.util.List<OperatorFactory<Function>> getFunctions()

getOperandFactory

public OperatorFactory<Operand> getOperandFactory(java.lang.String name)
Description copied from interface: OperatorSource
Returns the factory for the given Operand.

Specified by:
getOperandFactory in interface OperatorSource
Overrides:
getOperandFactory in class OperatorSourceImpl
Parameters:
name - The name of the operand.
Returns:
The factory for that Operand.

getFunctionFactory

public OperatorFactory<Function> getFunctionFactory(java.lang.String name)
Description copied from interface: OperatorSource
Returns the FunctionFactory for the given Function name.

Specified by:
getFunctionFactory in interface OperatorSource
Overrides:
getFunctionFactory in class OperatorSourceImpl
Parameters:
name - The name of the Function
Returns:
Operator Factory.

getOperand

public Operand getOperand(java.lang.String name)

getInstance

public static OperatorSourceImpl getInstance()
Returns the sole instance of this DataSource.

Returns:
The instance of this Source.

getAllFactories

public java.util.Map<java.lang.String,OperatorFactory<? extends Operator>> getAllFactories()
Returns all Factories combined. (Operand and Function Factories)

Returns:
a map of all factories.

main

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

Parameters:
args - The test method does not use any arguments currently, can be null.