Class AbstractConverter
- java.lang.Object
-
- de.timmfitschen.easyunits.UniqueSignatureObject
-
- de.timmfitschen.easyunits.conversion.AbstractConverter
-
- Direct Known Subclasses:
ChainConverter
,LinearConverter
public abstract class AbstractConverter extends UniqueSignatureObject implements Converter
-
-
Constructor Summary
Constructors Constructor Description AbstractConverter()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description Converter
concatenate(Converter nextConverter)
Return a converter which is equivalent to applying the `nextConverter` on the result of a conversion with this converter.protected abstract Converter
concatenateNonIdentityConverter(Converter nextConverter)
Return a new Converter by concatenating another converter to this converter.-
Methods inherited from class de.timmfitschen.easyunits.UniqueSignatureObject
equals
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface de.timmfitschen.easyunits.Signed
getSignature
-
-
-
-
Method Detail
-
concatenate
public Converter concatenate(Converter nextConverter)
Return a converter which is equivalent to applying the `nextConverter` on the result of a conversion with this converter. If `nextConverter` is null or the identity conversion, this converter is returned without instantiating a new converter. Otherwise, a new converter is instantiated while this converter is not altered. Usually, this method should not be overridden. Override the abstract method `concatenateNonIdentityConverter` instead.- Specified by:
concatenate
in interfaceConverter
- Returns:
- a converter
-
concatenateNonIdentityConverter
protected abstract Converter concatenateNonIdentityConverter(Converter nextConverter)
Return a new Converter by concatenating another converter to this converter. The new converter is equivalent to applying the `nextConverter` on the result of a conversion with this converter.- Parameters:
nextConverter
-- Returns:
- a new converter
-
-