hussam.math.operations
Class MyGroup
java.lang.Object
hussam.math.operations.MyGroup
- All Implemented Interfaces:
- Operation, OperationGroup
public class MyGroup
- extends java.lang.Object
- implements OperationGroup
This is an implementation for the OperationGroup interface.
- Author:
- ΝΣΗγ
| Constructor Summary |
|---|
MyGroup() Construcs a new OperationGroup with 0 operations. |
MyGroup(java.util.List<? extends Operation> ops) Construcs an OperationGroup giving a List of Operations. |
| Method Summary |
|---|
Operation | getOperation(int i) Returns the operation at the specified index. |
java.util.List<? extends Operation> | getOperations() Returns the list of operations. |
double | result() This implementation returns the first argument result! |
java.lang.String | toString() Returns a String describing this OperationGroup |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
MyGroup
public MyGroup(java.util.List<? extends Operation> ops)
- Construcs an OperationGroup giving a List of Operations.
- Parameters:
ops - the list of Operations.
MyGroup
public MyGroup()
- Construcs a new OperationGroup with 0 operations.
result
public double result()
throws MathException- This implementation returns the first argument result! It is the responsibility of other Operations to read all arguments. For example:
Function - Specified by:
result in interface Operation
- Returns:
- The result value.
- Throws:
MathException - Throws MathException if there is a Math Exception!!
getOperations
public java.util.List<? extends Operation> getOperations()
- Description copied from interface:
OperationGroup - Returns the list of operations.
- Specified by:
getOperations in interface OperationGroup
- Returns:
- The list of operations.
getOperation
public Operation getOperation(int i)
- Description copied from interface:
OperationGroup - Returns the operation at the specified index.
- Specified by:
getOperation in interface OperationGroup
- Parameters:
i - The index of the operation - Returns:
- the operation.
toString
public java.lang.String toString()
- Returns a String describing this OperationGroup
- Overrides:
toString in class java.lang.Object
- Returns:
- a description