FirstType
- Type of the first element of the pairSecondType
- Type of the second element of the pairPairType
- Type of the pairpublic abstract class AbstractCogxelPairConverter<FirstType,SecondType,PairType extends Pair<FirstType,SecondType>> extends AbstractCogxelConverter<PairType>
semanticIdentifierMap
Constructor and Description |
---|
AbstractCogxelPairConverter()
Creates a new instance of AbstractCogxelPairConverter
|
AbstractCogxelPairConverter(CogxelConverter<FirstType> firstConverter,
CogxelConverter<SecondType> secondConverter)
Creates a new instance of AbstractCogxelPairConverter
|
AbstractCogxelPairConverter(CogxelConverter<FirstType> firstConverter,
CogxelConverter<SecondType> secondConverter,
SemanticIdentifierMap semanticIdentifierMap)
Creates a new instance of AbstractCogxelPairConverter
|
Modifier and Type | Method and Description |
---|---|
AbstractCogxelPairConverter<FirstType,SecondType,PairType> |
clone()
This makes public the clone method on the
Object class and
removes the exception that it throws. |
abstract PairType |
createPair(FirstType first,
SecondType second)
Creates a Pair from the needed data
|
protected boolean |
equals(AbstractCogxelPairConverter<?,?,?> other)
Returns true if the two converters have equal internal converters.
|
boolean |
equals(java.lang.Object other) |
PairType |
fromCogxels(CogxelState cogxels)
Converts from a CogxelState object to an object of type DataType.
|
CogxelConverter<FirstType> |
getFirstConverter()
Getter for firstConverter
|
CogxelConverter<SecondType> |
getSecondConverter()
Getter for secondConverter
|
int |
hashCode() |
void |
setFirstConverter(CogxelConverter<FirstType> firstConverter)
Setter for firstConverter
|
void |
setSecondConverter(CogxelConverter<SecondType> secondConverter)
Setter for secondConverter
|
void |
setSemanticIdentifierMap(SemanticIdentifierMap semanticIdentifierMap)
Sets the SemanticIdentifierMap that the converter is to use.
|
void |
toCogxels(PairType data,
CogxelState cogxels)
Converts from an object of type DataType to an updated CogxelState.
|
buildIdentifierCache, getSemanticIdentifierMap
public AbstractCogxelPairConverter()
public AbstractCogxelPairConverter(CogxelConverter<FirstType> firstConverter, CogxelConverter<SecondType> secondConverter)
firstConverter
- The CogxelConverter for the first element of the pair.secondConverter
- The CogxelConverter for the second element of the pair.public AbstractCogxelPairConverter(CogxelConverter<FirstType> firstConverter, CogxelConverter<SecondType> secondConverter, SemanticIdentifierMap semanticIdentifierMap)
firstConverter
- The CogxelConverter for the first element of the pair.secondConverter
- The CogxelConverter for the second element of the pair.semanticIdentifierMap
- The SemanticIdentifierMap for the converter.public AbstractCogxelPairConverter<FirstType,SecondType,PairType> clone()
AbstractCloneableSerializable
Object
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<PairType extends Pair<FirstType,SecondType>>
clone
in interface CloneableSerializable
clone
in class AbstractCogxelConverter<PairType extends Pair<FirstType,SecondType>>
public boolean equals(java.lang.Object other)
equals
in class java.lang.Object
protected boolean equals(AbstractCogxelPairConverter<?,?,?> other)
other
- InputOutputPairCogxelConverter.public int hashCode()
hashCode
in class java.lang.Object
public abstract PairType createPair(FirstType first, SecondType second)
first
- First element of the Pairsecond
- Second element of the Pairpublic PairType fromCogxels(CogxelState cogxels)
CogxelConverter
cogxels
- The CogxelState to convert to DataType.public void toCogxels(PairType data, CogxelState cogxels)
CogxelConverter
data
- The object to convert into the CogxelState.cogxels
- The CogxelState to update with the converted data.public void setSemanticIdentifierMap(SemanticIdentifierMap semanticIdentifierMap)
CogxelConverter
setSemanticIdentifierMap
in interface CogxelConverter<PairType extends Pair<FirstType,SecondType>>
setSemanticIdentifierMap
in class AbstractCogxelConverter<PairType extends Pair<FirstType,SecondType>>
semanticIdentifierMap
- The SemanticIdentifierMap the converter is
to use.public CogxelConverter<FirstType> getFirstConverter()
public void setFirstConverter(CogxelConverter<FirstType> firstConverter)
firstConverter
- The CogxelConverter for the first element of the pair.public CogxelConverter<SecondType> getSecondConverter()
public void setSecondConverter(CogxelConverter<SecondType> secondConverter)
secondConverter
- The CogxelConverter for the second element of the pair.