edu.jhu.ece.iacl.jist.pipeline.parameter
Class ParamMatrix

java.lang.Object
  extended by edu.jhu.ece.iacl.jist.pipeline.PipePort<T>
      extended by edu.jhu.ece.iacl.jist.pipeline.parameter.ParamModel<Matrix>
          extended by edu.jhu.ece.iacl.jist.pipeline.parameter.ParamMatrix
All Implemented Interfaces:
java.lang.Cloneable, java.lang.Comparable<ParamModel>

public class ParamMatrix
extends ParamModel<Matrix>

Number Parameter storage.

Author:
Blake Lucas

Nested Class Summary
 
Nested classes/interfaces inherited from class edu.jhu.ece.iacl.jist.pipeline.PipePort
PipePort.PortListener, PipePort.type
 
Field Summary
protected  int cols
          The cols.
protected  Matrix matrix
          The matrix.
protected  int rows
          The rows.
 
Fields inherited from class edu.jhu.ece.iacl.jist.pipeline.parameter.ParamModel
cliTag, description, factory, hidden, label, loadAndSaveOnValidate, mandatory, shortLabel
 
Fields inherited from class edu.jhu.ece.iacl.jist.pipeline.PipePort
connectible, gport, incomingConnectors, listeners, maxIncoming, maxOutgoing, outgoingConnectors, owner, portType, useWire
 
Constructor Summary
ParamMatrix()
          Instantiates a new param matrix.
ParamMatrix(int rows, int cols)
          Instantiates a new param matrix.
ParamMatrix(Matrix mat)
          Instantiates a new param matrix.
ParamMatrix(java.lang.String name, int rows, int cols)
          Instantiates a new param matrix.
ParamMatrix(java.lang.String name, Matrix mat)
          Instantiates a new param matrix.
 
Method Summary
 ParamMatrix clone()
          Clone parameter.
 boolean equals(ParamModel<Matrix> model)
           
 int getCols()
          Gets the cols.
 java.lang.String getHumanReadableDataType()
           
 int getRows()
          Gets the rows.
 Matrix getValue()
          Get the value stored in the parameter.
 java.lang.String getXMLValue()
           
 void init()
          Initialized data that could not be deserialized.
 boolean isCompatible(PipePort model)
          Check compatibility between parameters.
 java.lang.String probeDefaultValue()
           
 void setCols(int cols)
          Sets the cols.
 void setRows(int rows)
          Sets the rows.
 void setValue(int i, int j, double val)
          Sets the value.
 void setValue(Matrix matrix)
          Set the parameter.
 void setXMLValue(java.lang.String arg)
           
 java.lang.String toString()
          Get description of parameter.
 void validate()
          Validate parameter associated with this port.
 
Methods inherited from class edu.jhu.ece.iacl.jist.pipeline.parameter.ParamModel
clean, compareTo, createMipavParameter, createTreeNode, dispose, getCliTag, getDescription, getFactory, getInputView, getLabel, getName, getOutputView, getShortLabel, getView, hide, importMipavParameter, importParameter, isConnectible, isHidden, isMandatory, loadResources, loadResources, read, read, replacePath, saveResources, setCliTag, setDescription, setFactory, setHidden, setInputView, setLabel, setLoadAndSaveOnValidate, setMandatory, setName, setOutputView, setShortLabel, toXML, write, write, writeAndFreeNow
 
Methods inherited from class edu.jhu.ece.iacl.jist.pipeline.PipePort
addListener, disconnect, disconnect, disconnect, disconnect, getGraphPort, getIncomingConnector, getIncomingConnectors, getIncomingPorts, getListeners, getMaxIncoming, getMaxOutgoing, getOutgoingConnector, getOutgoingConnectors, getOutgoingPorts, getOwner, getPortType, isConnected, isConnectedTo, isInputPort, isOutputPort, notifyListenersOfConnection, notifyListenersOfDisconnection, removeAllListeners, removeListener, setConnectable, setGraphPort, setMaxIncoming, setMaxOutgoing, setOwner, setPortType, setUseConnector, usingConnector
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

matrix

protected Matrix matrix
The matrix.


rows

protected int rows
The rows.


cols

protected int cols
The cols.

Constructor Detail

ParamMatrix

public ParamMatrix()
Instantiates a new param matrix.


ParamMatrix

public ParamMatrix(Matrix mat)
Instantiates a new param matrix.

Parameters:
mat - the mat

ParamMatrix

public ParamMatrix(java.lang.String name,
                   Matrix mat)
Instantiates a new param matrix.

Parameters:
name - the name
mat - the mat

ParamMatrix

public ParamMatrix(java.lang.String name,
                   int rows,
                   int cols)
Instantiates a new param matrix.

Parameters:
name - the name
rows - the rows
cols - the cols

ParamMatrix

public ParamMatrix(int rows,
                   int cols)
Instantiates a new param matrix.

Parameters:
rows - the rows
cols - the cols
Method Detail

clone

public ParamMatrix clone()
Description copied from class: PipePort
Clone parameter.

Specified by:
clone in class ParamModel<Matrix>
Returns:
the pipe port

getValue

public Matrix getValue()
Description copied from class: ParamModel
Get the value stored in the parameter.

Specified by:
getValue in class ParamModel<Matrix>
Returns:
this the default value stored by the parameter. Although, parameters could potentially store more than one type of value.

isCompatible

public boolean isCompatible(PipePort model)
Check compatibility between parameters.

Overrides:
isCompatible in class ParamModel<Matrix>
Parameters:
model - the model
Returns:
true, if checks if is compatible

setValue

public void setValue(Matrix matrix)
Set the parameter. The value must be of Number type.

Specified by:
setValue in class ParamModel<Matrix>
Parameters:
matrix - the matrix

setValue

public void setValue(int i,
                     int j,
                     double val)
Sets the value.

Parameters:
i - the i
j - the j
val - the val

toString

public java.lang.String toString()
Description copied from class: ParamModel
Get description of parameter.

Specified by:
toString in class ParamModel<Matrix>
Returns:
the string

validate

public void validate()
              throws InvalidParameterException
Description copied from class: PipePort
Validate parameter associated with this port.

Specified by:
validate in class ParamModel<Matrix>
Throws:
InvalidParameterException - the invalid parameter exception

init

public void init()
Description copied from class: PipePort
Initialized data that could not be deserialized.

Specified by:
init in class PipePort<Matrix>

getRows

public int getRows()
Gets the rows.

Returns:
the rows

setRows

public void setRows(int rows)
Sets the rows.

Parameters:
rows - the new rows

getCols

public int getCols()
Gets the cols.

Returns:
the cols

setCols

public void setCols(int cols)
Sets the cols.

Parameters:
cols - the new cols

equals

public boolean equals(ParamModel<Matrix> model)
Overrides:
equals in class ParamModel<Matrix>

getHumanReadableDataType

public java.lang.String getHumanReadableDataType()
Specified by:
getHumanReadableDataType in class ParamModel<Matrix>

getXMLValue

public java.lang.String getXMLValue()
Specified by:
getXMLValue in class ParamModel<Matrix>

setXMLValue

public void setXMLValue(java.lang.String arg)
Specified by:
setXMLValue in class ParamModel<Matrix>

probeDefaultValue

public java.lang.String probeDefaultValue()
Specified by:
probeDefaultValue in class ParamModel<Matrix>