hussam.math.operations.factory
Class OperatorFactoryImpl<T extends Operator>

java.lang.Object
extended by hussam.math.operations.factory.OperatorFactoryImpl<T>
All Implemented Interfaces:
OperatorFactory<T>, java.io.Serializable, java.lang.Comparable<Operator>
Direct Known Subclasses:
CustomFunctionFactory

public abstract class OperatorFactoryImpl<T extends Operator>
extends java.lang.Object
implements OperatorFactory<T>, java.lang.Comparable<Operator>

This is the default implemetation for all factories.

Author:
Hussam Almulhim حسام الملحم
See Also:
OperatorFactoryDB, CustomFunctionFactory, Serialized Form

Constructor Summary
OperatorFactoryImpl(java.lang.String name, java.lang.String description)
          Construcs a new Factory with a default of 2 default arguemtn count.
OperatorFactoryImpl(java.lang.String name, java.lang.String description, int arguments)
          Construcs a new Factory.
 
Method Summary
 intcompareTo(Operator fac)
           
 intgetDefaultArgumentCount()
          Returns the default number of arguments for this operator.
 java.lang.StringgetDescription()
          Returns a description of this operator.
 java.lang.StringgetName()
          Returns the name of this operator.
 java.lang.StringtoString()
          Returns a description of this factory.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface hussam.math.operations.factory.OperatorFactory
getNewOperator
 

Constructor Detail

OperatorFactoryImpl

public OperatorFactoryImpl(java.lang.String name,
                           java.lang.String description,
                           int arguments)
Construcs a new Factory.

Parameters:
name - The name of the factory.
description - description
arguments - The default number of arguments.

OperatorFactoryImpl

public OperatorFactoryImpl(java.lang.String name,
                           java.lang.String description)
Construcs a new Factory with a default of 2 default arguemtn count.

Parameters:
name - the name of the factory.
description - The description
Method Detail

getDefaultArgumentCount

public int getDefaultArgumentCount()
Description copied from interface: OperatorFactory
Returns the default number of arguments for this operator.

Specified by:
getDefaultArgumentCount in interface OperatorFactory<T extends Operator>
Returns:
the default argument count for this operator.

getName

public java.lang.String getName()
Description copied from interface: OperatorFactory
Returns the name of this operator.

Specified by:
getName in interface OperatorFactory<T extends Operator>
Returns:
The name of the factory.

getDescription

public java.lang.String getDescription()
Description copied from interface: OperatorFactory
Returns a description of this operator.

Specified by:
getDescription in interface OperatorFactory<T extends Operator>
Returns:
a description.

compareTo

public int compareTo(Operator fac)
Specified by:
compareTo in interface java.lang.Comparable<Operator>
Parameters:
fac - The factory to be compared with.
Returns:
-1,0,1

toString

public java.lang.String toString()
Returns a description of this factory.

Overrides:
toString in class java.lang.Object
Returns:
a description.