public class CogxelVectorConverter extends gov.sandia.cognition.math.matrix.DefaultVectorFactoryContainer implements CogxelConverter<gov.sandia.cognition.math.matrix.Vector>
| Constructor and Description |
|---|
CogxelVectorConverter()
Creates a new, empty instance of VectorCogxelMap.
|
CogxelVectorConverter(CogxelVectorConverter other)
Creates a new copy of the given CogxelVectorConverter.
|
CogxelVectorConverter(Iterable<SemanticLabel> labels)
Creates a new CogxelVectorConverter from the given labels.
|
CogxelVectorConverter(Iterable<SemanticLabel> labels,
SemanticIdentifierMap semanticIdentifierMap)
Creates a new CogxelVectorConverter from the given SemanticIdentifierMap
and SemanticLabels.
|
CogxelVectorConverter(Iterable<SemanticLabel> labels,
SemanticIdentifierMap semanticIdentifierMap,
gov.sandia.cognition.math.matrix.VectorFactory<?> vectorFactory,
CogxelFactory cogxelFactory)
Creates a new CogxelVectorConverter.
|
CogxelVectorConverter(SemanticLabel... labels)
Creates a new CogxelVectorConverter from the given labels.
|
CogxelVectorConverter(SemanticLabel[] labels,
SemanticIdentifierMap semanticIdentifierMap)
Creates a new CogxelVectorConverter from the given SemanticIdentifierMap
and SemanticLabels.
|
CogxelVectorConverter(SemanticLabel[] labels,
SemanticIdentifierMap semanticIdentifierMap,
gov.sandia.cognition.math.matrix.VectorFactory<?> vectorFactory,
CogxelFactory cogxelFactory)
Creates a new CogxelVectorConverter
|
| Modifier and Type | Method and Description |
|---|---|
void |
addLabel(SemanticLabel label)
Adds the given SemanticLabel to the list of labels used by the
converter.
|
void |
addLabels(Iterable<SemanticLabel> labels)
Adds all of the given labels to the converter.
|
void |
addLabels(SemanticLabel[] labels)
Adds all of the given labels to the converter.
|
protected void |
addLabelToIdentifierCache(SemanticLabel label)
Adds the given label to the cache of SemanticIdentifiers.
|
protected void |
buildIdentifierCache()
Rebuilds the cache of SemanticIdentifier objects.
|
CogxelVectorConverter |
clone() |
gov.sandia.cognition.math.matrix.Vector |
createEmptyVector()
Creates an empty Vector for the converter, of the proper dimensionality.
|
boolean |
equals(CogxelVectorConverter other)
Returns true if the two converters have the same labels.
|
boolean |
equals(Object other) |
protected int |
findIndexForIdentifier(SemanticIdentifier identifier)
Finds the vector index for the given SemanticIdentifier.
|
gov.sandia.cognition.math.matrix.Vector |
fromCogxels(CogxelState cogxels)
Converts from a CogxelState object to an object of type DataType.
|
CogxelFactory |
getCogxelFactory()
Gets the CogxelFactory used to create the Cogxels used by the converter.
|
int |
getDimensionality()
Gets the dimensionality of the Vector created by the converter.
|
protected ArrayList<SemanticIdentifier> |
getIdentifiers()
Gets the list of cached SemanticIdentifiers.
|
protected HashMap<SemanticIdentifier,Integer> |
getIdentifierToIndexMap()
Gets the cached mapping of SemanticIdentifier to vector index.
|
ArrayList<SemanticLabel> |
getLabels()
Gets the labels used by the converter, each one corresponding to one
dimension in the converted Vector.
|
SemanticIdentifierMap |
getSemanticIdentifierMap()
Gets the SemanticIdentifierMap used by this converter.
|
int |
hashCode() |
void |
setCogxelFactory(CogxelFactory cogxelFactory)
Gets the CogxelFactory used to create the Cogxels used by the converter.
|
protected void |
setIdentifiers(ArrayList<SemanticIdentifier> identifiers)
Sets the list of cached SemanticIdentifiers.
|
protected void |
setIdentifierToIndexMap(HashMap<SemanticIdentifier,Integer> identifierToIndexMap)
Sets the cached mapping of SemanticIdentifier to vector index.
|
void |
setLabels(ArrayList<SemanticLabel> labels)
Sets the labels to be used by the converter, each one corresponding to
one dimension in the converted Vector.
|
void |
setSemanticIdentifierMap(SemanticIdentifierMap semanticIdentifierMap)
Sets the SemanticIdentifierMap that the converter is to use.
|
void |
toCogxels(gov.sandia.cognition.math.matrix.Vector data,
CogxelState cogxels)
Converts from an object of type DataType to an updated CogxelState.
|
public CogxelVectorConverter()
public CogxelVectorConverter(SemanticLabel... labels)
labels - The labels to use.public CogxelVectorConverter(Iterable<SemanticLabel> labels)
labels - The labels to use.public CogxelVectorConverter(SemanticLabel[] labels, SemanticIdentifierMap semanticIdentifierMap)
labels - The labels to use.semanticIdentifierMap - The SemanticIdentifierMap to use.public CogxelVectorConverter(Iterable<SemanticLabel> labels, SemanticIdentifierMap semanticIdentifierMap)
labels - The labels to use.semanticIdentifierMap - The SemanticIdentifierMap to use.public CogxelVectorConverter(SemanticLabel[] labels, SemanticIdentifierMap semanticIdentifierMap, gov.sandia.cognition.math.matrix.VectorFactory<?> vectorFactory, CogxelFactory cogxelFactory)
labels - The labels to use.semanticIdentifierMap - The SemanticIdentifierMap to use.vectorFactory - The VectorFactory to use.cogxelFactory - The CogxelFactory to use.public CogxelVectorConverter(Iterable<SemanticLabel> labels, SemanticIdentifierMap semanticIdentifierMap, gov.sandia.cognition.math.matrix.VectorFactory<?> vectorFactory, CogxelFactory cogxelFactory)
labels - The labels to use.semanticIdentifierMap - The SemanticIdentifierMap to use.vectorFactory - The VectorFactory to use.cogxelFactory - The CogxelFactory to use.public CogxelVectorConverter(CogxelVectorConverter other)
other - The CogxeLVectorConverter to copy.public CogxelVectorConverter clone()
clone in interface CogxelConverter<gov.sandia.cognition.math.matrix.Vector>clone in interface gov.sandia.cognition.util.CloneableSerializableclone in class gov.sandia.cognition.util.AbstractCloneableSerializablepublic void addLabel(SemanticLabel label)
label - The label to add.public void addLabels(Iterable<SemanticLabel> labels)
labels - The labels to add to the converter.public void addLabels(SemanticLabel[] labels)
labels - The labels to add to the converter.protected void buildIdentifierCache()
protected void addLabelToIdentifierCache(SemanticLabel label)
label - The label to add.public gov.sandia.cognition.math.matrix.Vector fromCogxels(CogxelState cogxels)
fromCogxels in interface CogxelConverter<gov.sandia.cognition.math.matrix.Vector>cogxels - The CogxelState to convert to DataType.public void toCogxels(gov.sandia.cognition.math.matrix.Vector data,
CogxelState cogxels)
toCogxels in interface CogxelConverter<gov.sandia.cognition.math.matrix.Vector>data - The object to convert into the CogxelState.cogxels - The CogxelState to update with the converted data.protected int findIndexForIdentifier(SemanticIdentifier identifier)
identifier - The SemanticIdentifier to find the integer index for.public boolean equals(Object other)
public boolean equals(CogxelVectorConverter other)
other - Another CogxelVectorConverter.public gov.sandia.cognition.math.matrix.Vector createEmptyVector()
public int getDimensionality()
public SemanticIdentifierMap getSemanticIdentifierMap()
getSemanticIdentifierMap in interface CogxelConverter<gov.sandia.cognition.math.matrix.Vector>public void setSemanticIdentifierMap(SemanticIdentifierMap semanticIdentifierMap)
setSemanticIdentifierMap in interface CogxelConverter<gov.sandia.cognition.math.matrix.Vector>semanticIdentifierMap - The SemanticIdentifierMap the converter is
to use.public ArrayList<SemanticLabel> getLabels()
public void setLabels(ArrayList<SemanticLabel> labels)
labels - The labels to be used by the converter.protected ArrayList<SemanticIdentifier> getIdentifiers()
protected void setIdentifiers(ArrayList<SemanticIdentifier> identifiers)
identifiers - The list of cached SemanticIdentifiers.protected HashMap<SemanticIdentifier,Integer> getIdentifierToIndexMap()
protected void setIdentifierToIndexMap(HashMap<SemanticIdentifier,Integer> identifierToIndexMap)
identifierToIndexMap - The cached mapping of SemanticIdentifier
to vector index.public CogxelFactory getCogxelFactory()
public void setCogxelFactory(CogxelFactory cogxelFactory)
cogxelFactory - The CogxelFactory used to create the Cogxels used
by the converter.Copyright © 2006–2015 Sandia National Laboratories. All rights reserved.