DC
- Represented DescriptorComparator
typeD
- Descriptor bare representationpublic class SerializingComparisonContextFactory<DC extends DescriptorComparator<D>,D extends Descriptor> extends Object implements ComparisonContextFactory<DC,D,byte[]>
Guarded.EnsureThat, Guarded.New
MetricFactory.ToLinenote<C>
Constructor and Description |
---|
SerializingComparisonContextFactory(DescriptorSerializer<D> serializer,
DC comparator)
Construct.
|
Modifier and Type | Method and Description |
---|---|
Linenote<ComparisonContext<DC,D,byte[]>> |
comparisonLinenote()
Gets the string based parameterization description.
|
ComparisonContext<DC,D,byte[]> |
defaultComparison()
Gets the default comparator object.
|
DescriptorSerializer<D> |
descriptorSerializer()
Associated descriptor serializer.
|
ComparisonContext<DC,D,byte[]> |
forComparator(DC comparator)
Use a
DescriptorComparator as underlying UnguardedDissimilarityCalculator . |
static <D extends Descriptor> |
forGenerator(DescriptorGenerator<D> generator)
Construct for a generator with default comparator.
|
Object |
getGuardObject()
Gets the guard object associated to the generated descriptors/utilities.
|
Class<? extends MetricFactory> |
metricFactoryClass()
Represented metric factory class.
|
String |
toString() |
SerializingComparisonContextFactory<DC,D> |
withComparator(DC comparator) |
public SerializingComparisonContextFactory(DescriptorSerializer<D> serializer, DC comparator)
serializer
- Underlying serializer
comparator
- Exposed comparatorpublic Class<? extends MetricFactory> metricFactoryClass()
ComparisonContextFactory
Description
annotation.metricFactoryClass
in interface ComparisonContextFactory<DC extends DescriptorComparator<D>,D extends Descriptor,byte[]>
public static <D extends Descriptor> SerializingComparisonContextFactory<DescriptorComparator<D>,D> forGenerator(DescriptorGenerator<D> generator)
D
- Represented descriptor typegenerator
- Generatorpublic ComparisonContext<DC,D,byte[]> defaultComparison()
MetricFactory
defaultComparison
in interface MetricFactory<ComparisonContext<DC extends DescriptorComparator<D>,D extends Descriptor,byte[]>>
public SerializingComparisonContextFactory<DC,D> withComparator(DC comparator)
public ComparisonContext<DC,D,byte[]> forComparator(DC comparator)
DescriptorComparator
as underlying UnguardedDissimilarityCalculator
.
Note that the supplied comparator
must be compatible with the underlying generator
.comparator
- Comparator to usepublic Object getGuardObject()
Guarded
This method is intended to use only for ensuring the compatibility of manipulated objects.
Implementations might use the associated DescriptorGenerator
or DescriptorParameters
reference as
the guard object, however it is a non recommended practice to use this method to access the associated generator
to perform further operations on it.
getGuardObject
in interface Guarded
null
.public DescriptorSerializer<D> descriptorSerializer()
ComparisonContextFactory
descriptorSerializer
in interface ComparisonContextFactory<DC extends DescriptorComparator<D>,D extends Descriptor,byte[]>
public Linenote<ComparisonContext<DC,D,byte[]>> comparisonLinenote()
MetricFactory
comparisonLinenote
in interface MetricFactory<ComparisonContext<DC extends DescriptorComparator<D>,D extends Descriptor,byte[]>>