gov.sandia.cognition.framework.learning.converter
Class CogxelMatrixConverter

java.lang.Object
  extended by gov.sandia.cognition.framework.learning.converter.CogxelMatrixConverter
All Implemented Interfaces:
CogxelConverter<Matrix>, CloneableSerializable, Serializable, Cloneable

public class CogxelMatrixConverter
extends Object
implements CogxelConverter<Matrix>

The CogxelVectorConverter implements a converter to convert Cogxels to and from Matrix objects.

Since:
1.0
Author:
Kevin R. Dixon
See Also:
Serialized Form

Constructor Summary
CogxelMatrixConverter(ArrayList<CogxelVectorConverter> columnConverters)
          Creates a new instance of CogxelMatrixConverter
CogxelMatrixConverter(ArrayList<CogxelVectorConverter> columnConverters, SemanticIdentifierMap semanticIdentifierMap)
          Creates a new instance of CogxelMatrixConverter
CogxelMatrixConverter(CogxelMatrixConverter other)
          Copy constructor
CogxelMatrixConverter(Collection<? extends Iterable<SemanticLabel>> columns)
          Creates a new instance of CogxelMatrixConverter
 
Method Summary
 CogxelMatrixConverter clone()
          Creates a new clone (shallow copy) of this object.
 Matrix fromCogxels(CogxelState cogxels)
          Converts from a CogxelState object to an object of type DataType.
 ArrayList<CogxelVectorConverter> getColumnConverters()
          Getter for columnConverters
 SemanticIdentifierMap getSemanticIdentifierMap()
          Gets the SemanticIdentifierMap used by this converter.
protected  void setColumnConverters(ArrayList<CogxelVectorConverter> columnConverters)
          Setter for columnConverters
 void setSemanticIdentifierMap(SemanticIdentifierMap semanticIdentifierMap)
          Sets the SemanticIdentifierMap that the converter is to use.
 void toCogxels(Matrix data, CogxelState cogxels)
          Converts from an object of type DataType to an updated CogxelState.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CogxelMatrixConverter

public CogxelMatrixConverter(Collection<? extends Iterable<SemanticLabel>> columns)
Creates a new instance of CogxelMatrixConverter

Parameters:
columns - Iterable of SemanticLabels to create CogxelVectorConverters from

CogxelMatrixConverter

public CogxelMatrixConverter(ArrayList<CogxelVectorConverter> columnConverters)
Creates a new instance of CogxelMatrixConverter

Parameters:
columnConverters - Collection CogxelVectorConverters that convert the columns of the matrix

CogxelMatrixConverter

public CogxelMatrixConverter(ArrayList<CogxelVectorConverter> columnConverters,
                             SemanticIdentifierMap semanticIdentifierMap)
Creates a new instance of CogxelMatrixConverter

Parameters:
columnConverters - Collection CogxelVectorConverters that convert the columns of the matrix
semanticIdentifierMap - SemanticIdentifierMap for the converter

CogxelMatrixConverter

public CogxelMatrixConverter(CogxelMatrixConverter other)
Copy constructor

Parameters:
other - CogxelMatrixConverter to clone
Method Detail

clone

public CogxelMatrixConverter clone()
Creates a new clone (shallow copy) of this object.

Specified by:
clone in interface CogxelConverter<Matrix>
Specified by:
clone in interface CloneableSerializable
Overrides:
clone in class Object
Returns:
A new clone (shallow copy) of this object.

getSemanticIdentifierMap

public SemanticIdentifierMap getSemanticIdentifierMap()
Gets the SemanticIdentifierMap used by this converter.

Specified by:
getSemanticIdentifierMap in interface CogxelConverter<Matrix>
Returns:
The SemanticIdentifierMap used by this converter.

setSemanticIdentifierMap

public void setSemanticIdentifierMap(SemanticIdentifierMap semanticIdentifierMap)
Sets the SemanticIdentifierMap that the converter is to use.

Specified by:
setSemanticIdentifierMap in interface CogxelConverter<Matrix>
Parameters:
semanticIdentifierMap - The SemanticIdentifierMap the converter is to use.

fromCogxels

public Matrix fromCogxels(CogxelState cogxels)
Converts from a CogxelState object to an object of type DataType.

Specified by:
fromCogxels in interface CogxelConverter<Matrix>
Parameters:
cogxels - The CogxelState to convert to DataType.
Returns:
An object of DataType extracted from the given CogxelState.

toCogxels

public void toCogxels(Matrix data,
                      CogxelState cogxels)
Converts from an object of type DataType to an updated CogxelState.

Specified by:
toCogxels in interface CogxelConverter<Matrix>
Parameters:
data - The object to convert into the CogxelState.
cogxels - The CogxelState to update with the converted data.

getColumnConverters

public ArrayList<CogxelVectorConverter> getColumnConverters()
Getter for columnConverters

Returns:
Collection CogxelVectorConverters that convert the columns of the matrix

setColumnConverters

protected void setColumnConverters(ArrayList<CogxelVectorConverter> columnConverters)
Setter for columnConverters

Parameters:
columnConverters - Collection CogxelVectorConverters that convert the columns of the matrix