public class CogxelBooleanConverter extends AbstractCogxelConverter<java.lang.Boolean>
CogxelConverter that encodes booleans as positive and
negative values (+1/-1).semanticIdentifierMap| Constructor and Description |
|---|
CogxelBooleanConverter()
Creates a new instance of CogxelBooleanConverter.
|
CogxelBooleanConverter(SemanticLabel label)
Creates a new instance of CogxelDoubleConverter.
|
CogxelBooleanConverter(SemanticLabel label,
SemanticIdentifierMap semanticIdentifierMap)
Creates a new instance of CogxelBooleanConverter.
|
CogxelBooleanConverter(SemanticLabel label,
SemanticIdentifierMap semanticIdentifierMap,
CogxelFactory cogxelFactory)
Creates a new instance of CogxelBooleanConverter.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
buildIdentifierCache()
Rebuilds the cache of SemanticIdentifier objects.
|
CogxelBooleanConverter |
clone()
This makes public the clone method on the
Object class and
removes the exception that it throws. |
boolean |
equals(CogxelBooleanConverter other)
This converter equals another converter of the same type if their labels
are equal.
|
boolean |
equals(java.lang.Object other) |
java.lang.Boolean |
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.
|
protected SemanticIdentifier |
getIdentifier()
Gets the semantic identifier of the cogxel to convert.
|
SemanticLabel |
getLabel()
Gets the label of the cogxel to convert.
|
int |
hashCode() |
void |
setCogxelFactory(CogxelFactory cogxelFactory)
Gets the CogxelFactory used to create the cogxels used by the converter.
|
protected void |
setIdentifier(SemanticIdentifier identifier)
Gets the semantic identifier of the cogxel to convert.
|
void |
setLabel(SemanticLabel label)
Sets the label of the cogxel to convert.
|
void |
toCogxels(java.lang.Boolean data,
CogxelState cogxels)
Converts from an object of type DataType to an updated CogxelState.
|
getSemanticIdentifierMap, setSemanticIdentifierMappublic CogxelBooleanConverter()
public CogxelBooleanConverter(SemanticLabel label)
label - The label for the Cogxel to convert.public CogxelBooleanConverter(SemanticLabel label, SemanticIdentifierMap semanticIdentifierMap)
label - The label for the Cogxel to convert.semanticIdentifierMap - The SemanticIdentifierMap for the
converter.public CogxelBooleanConverter(SemanticLabel label, SemanticIdentifierMap semanticIdentifierMap, CogxelFactory cogxelFactory)
label - The label for the Cogxel to convert.semanticIdentifierMap - The SemanticIdentifierMap for the
converter.cogxelFactory - The CogxelFactory to use.public CogxelBooleanConverter clone()
AbstractCloneableSerializableObject class and
removes the exception that it throws. Its default behavior is to
automatically create a clone of the exact type of object that the
clone is called on and to copy all primitives but to keep all references,
which means it is a shallow copy.
Extensions of this class may want to override this method (but call
super.clone() to implement a "smart copy". That is, to target
the most common use case for creating a copy of the object. Because of
the default behavior being a shallow copy, extending classes only need
to handle fields that need to have a deeper copy (or those that need to
be reset). Some of the methods in ObjectUtil may be helpful in
implementing a custom clone method.
Note: The contract of this method is that you must use
super.clone() as the basis for your implementation.clone in interface CogxelConverter<java.lang.Boolean>clone in interface CloneableSerializableclone in class AbstractCogxelConverter<java.lang.Boolean>public boolean equals(java.lang.Object other)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(CogxelBooleanConverter other)
other - The other converter.protected void buildIdentifierCache()
AbstractCogxelConverterbuildIdentifierCache in class AbstractCogxelConverter<java.lang.Boolean>public java.lang.Boolean fromCogxels(CogxelState cogxels)
CogxelConvertercogxels - The CogxelState to convert to DataType.public void toCogxels(java.lang.Boolean data,
CogxelState cogxels)
CogxelConverterdata - The object to convert into the CogxelState.cogxels - The CogxelState to update with the converted data.public SemanticLabel getLabel()
public void setLabel(SemanticLabel label)
label - The label of the cogxel to convert.protected SemanticIdentifier getIdentifier()
protected void setIdentifier(SemanticIdentifier identifier)
identifier - The semantic identifier of the cogxel to convert.public CogxelFactory getCogxelFactory()
public void setCogxelFactory(CogxelFactory cogxelFactory)
cogxelFactory - The CogxelFactory used to create the cogxels used
by the converter.