public class FieldSampleComparator extends Object implements SampleComparator
| Constructor and Description |
|---|
FieldSampleComparator(String fieldName) |
| Modifier and Type | Method and Description |
|---|---|
long |
compare(Sample s1,
Sample s2)
Compares to sample
|
void |
initialize(SampleMetadata metadata)
Initializes the comparator with the
SampleMetadata of the samples
to be compared. |
public FieldSampleComparator(String fieldName)
public final void initialize(SampleMetadata metadata)
SampleComparatorSampleMetadata of the samples
to be compared.
This function is invoked before any call to thecompare
service.
Not that this function is the place to get sample column indexes for better performance
initialize in interface SampleComparatormetadata - The metadata of the sample to be compared by this instancepublic long compare(Sample s1, Sample s2)
SampleComparatorMust return an long integer that define the relational order of the 2 compared samples:
compare in interface SampleComparators1 - The first sample to be compareds2 - The second sample to compareds1 < s2, 0 if s1 = s2,
a positive integer if s1 > s2Copyright © 1998-2020 Apache Software Foundation. All Rights Reserved.