de.unihalle.informatik.Alida.demo
Class ApplyToMatrix

java.lang.Object
  extended by de.unihalle.informatik.Alida.operator.ALDOperator
      extended by de.unihalle.informatik.Alida.demo.ApplyToMatrix
All Implemented Interfaces:
ALDConfigurationValidator

@ALDAOperator(genericExecutionMode=ALL,
              level=APPLICATION)
public class ApplyToMatrix
extends ALDOperator

Demo operator to apply a summarizing operation to a 2D array in row or column wise fashion. The summarizing operator is assumed to take a 1D array as input and return a summarizing scalar, e.g. the mean or the maxium value.

Author:
posch

Nested Class Summary
static class ApplyToMatrix.SummarizeMode
          Choose row or colum wise sum
 
Nested classes/interfaces inherited from class de.unihalle.informatik.Alida.operator.ALDOperator
ALDOperator.HidingMode
 
Field Summary
private  long elapsedTime
          Elpased time
private  java.lang.Double[][] matrix
          Input matrix
private  boolean returnElapsedTime
          Supplemental to request elapsed time to be returned
private  java.lang.Double[] summaries
          1D Array of summaries.
private  ApplyToMatrix.SummarizeMode summarizeMode
          Mode of summarizing
private  ALDSummarizeArrayOp summarizeOp
          Summarizing opererator
 
Fields inherited from class de.unihalle.informatik.Alida.operator.ALDOperator
completeDAG, name, portHashAccess, verbose, versionProvider
 
Constructor Summary
ApplyToMatrix()
          Default constructor.
ApplyToMatrix(java.lang.Double[][] _matrix)
          Constructor.
 
Method Summary
 long getElapsedTime()
          Get value of elapsedTime.
 java.lang.Double[][] getMatrix()
          Get value of matrix.
 boolean getReturnElapsedTime()
          Get value of returnElapsedTime.
 java.lang.Double[] getSummaries()
          Get value of summaries.
 ApplyToMatrix.SummarizeMode getSummarizeMode()
          Get value of summarizeMode.
 ALDSummarizeArrayOp getSummarizeOp()
          Get value of summarizeOp.
 java.lang.Boolean getVerbose()
          Get value of verbose.
protected  void operate()
          This method does the actual work and needs to be implemented by every subclass.
 void setElapsedTime(long value)
          Set value of elapsedTime.
 void setMatrix(java.lang.Double[][] value)
          Set value of matrix.
 void setReturnElapsedTime(boolean value)
          Set value of returnElapsedTime.
 void setSummaries(java.lang.Double[] value)
          Set value of summaries.
 void setSummarizeMode(ApplyToMatrix.SummarizeMode value)
          Set value of summarizeMode.
 void setSummarizeOp(ALDSummarizeArrayOp value)
          Set value of summarizeOp.
 void setVerbose(java.lang.Boolean value)
          Set value of verbose.
 
Methods inherited from class de.unihalle.informatik.Alida.operator.ALDOperator
deserializeFromXmlFile, fieldContained, getALDPortHashAccessKey, getConstructionMode, getInInoutNames, getInInoutNames, getInNames, getInOutNames, getMissingRequiredInputs, getName, getNumParameters, getOutInoutNames, getOutNames, getParameter, getParameterDescriptor, getParameterNames, getSupplementalNames, getVersion, isConfigured, parametersToXmlObject, print, print, print, printInterface, printInterface, readHistory, readResolve, reinitializeParameterDescriptors, runOp, runOp, runOp, serializeToXmlFile, setConstructionMode, setName, setParameter, setParametersFromXml, setParametersFromXml, toStringVerbose, unconfiguredItems, validate, validateCustom, validateGeneric, writeHistory, writeHistory, writeHistory, writeParametersToXml
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

elapsedTime

@Parameter(label="Elapsed time",
           direction=OUT,
           description="Elapsed time of operation in milliseconds",
           supplemental=true)
private long elapsedTime
Elpased time


matrix

@Parameter(label="Input matrix",
           required=true,
           direction=IN,
           description="Input matrix.")
private java.lang.Double[][] matrix
Input matrix


returnElapsedTime

@Parameter(label="Return elapsed time",
           direction=IN,
           description="Request elapsed time consumed to be returned",
           supplemental=true)
private boolean returnElapsedTime
Supplemental to request elapsed time to be returned


summaries

@Parameter(label="summaries",
           direction=OUT,
           description="Row or column wise summaries")
private transient java.lang.Double[] summaries
1D Array of summaries.


summarizeMode

@Parameter(label="Summarize mode",
           required=true,
           direction=IN,
           description="Sum over columns or rows.")
private ApplyToMatrix.SummarizeMode summarizeMode
Mode of summarizing


summarizeOp

@Parameter(label="Summarizing operator",
           required=true,
           direction=IN,
           description="Specifies the summarizing operation to apply")
private ALDSummarizeArrayOp summarizeOp
Summarizing opererator

Constructor Detail

ApplyToMatrix

public ApplyToMatrix()
              throws ALDOperatorException
Default constructor.

Throws:
ALDOperatorException

ApplyToMatrix

public ApplyToMatrix(java.lang.Double[][] _matrix)
              throws ALDOperatorException
Constructor.

Parameters:
matrix - Input matrix.
Throws:
ALDOperatorException
Method Detail

getElapsedTime

public long getElapsedTime()
Get value of elapsedTime. Explanation: Elapdes time of operation in milliseconds.

Returns:
value of elapsedTime

getMatrix

public java.lang.Double[][] getMatrix()
Get value of matrix. Explanation: Input matrix..

Returns:
value of matrix

getReturnElapsedTime

public boolean getReturnElapsedTime()
Get value of returnElapsedTime. Explanation: Request elapsed time consumed to be returned.

Returns:
value of returnElapsedTime

getSummaries

public java.lang.Double[] getSummaries()
Get value of summaries. Explanation: Row or column wise summaries.

Returns:
value of summaries

getSummarizeMode

public ApplyToMatrix.SummarizeMode getSummarizeMode()
Get value of summarizeMode. Explanation: Sum over columns or rows..

Returns:
value of summarizeMode

getSummarizeOp

public ALDSummarizeArrayOp getSummarizeOp()
Get value of summarizeOp. Explanation: Specifies the summarizing operation to apply.

Returns:
value of summarizeOp

getVerbose

public java.lang.Boolean getVerbose()
Get value of verbose. Explanation: Verbose flag.

Overrides:
getVerbose in class ALDOperator
Returns:
value of verbose

operate

protected void operate()
                throws ALDOperatorException,
                       ALDProcessingDAGException
Description copied from class: ALDOperator
This method does the actual work and needs to be implemented by every subclass.

Specified by:
operate in class ALDOperator
Throws:
ALDOperatorException
ALDProcessingDAGException

setElapsedTime

public void setElapsedTime(long value)
Set value of elapsedTime. Explanation: Elapdes time of operation in milliseconds.

Parameters:
value - New value of elapsedTime

setMatrix

public void setMatrix(java.lang.Double[][] value)
Set value of matrix. Explanation: Input matrix..

Parameters:
value - New value of matrix

setReturnElapsedTime

public void setReturnElapsedTime(boolean value)
Set value of returnElapsedTime. Explanation: Request elapsed time consumed to be returned.

Parameters:
value - New value of returnElapsedTime

setSummaries

public void setSummaries(java.lang.Double[] value)
Set value of summaries. Explanation: Row or column wise summaries.

Parameters:
value - New value of summaries

setSummarizeMode

public void setSummarizeMode(ApplyToMatrix.SummarizeMode value)
Set value of summarizeMode. Explanation: Sum over columns or rows..

Parameters:
value - New value of summarizeMode

setSummarizeOp

public void setSummarizeOp(ALDSummarizeArrayOp value)
Set value of summarizeOp. Explanation: Specifies the summarizing operation to apply.

Parameters:
value - New value of summarizeOp

setVerbose

public void setVerbose(java.lang.Boolean value)
Set value of verbose. Explanation: Verbose flag.

Overrides:
setVerbose in class ALDOperator
Parameters:
value - New value of verbose