Revision 1b5c38e1
Added by Andreas Müller almost 8 years ago
cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/taxon/HomotypicGroupTaxonComparator.java | ||
---|---|---|
42 | 42 |
*/ |
43 | 43 |
public class HomotypicGroupTaxonComparator extends TaxonComparator { |
44 | 44 |
private static final long serialVersionUID = -5088210641256430878L; |
45 |
@SuppressWarnings("unused") |
|
46 | 45 |
private static final Logger logger = Logger.getLogger(HomotypicGroupTaxonComparator.class); |
47 | 46 |
|
48 | 47 |
private final TaxonBase<?> firstTaxonInGroup; |
... | ... | |
80 | 79 |
|
81 | 80 |
TaxonNameBase<?,?> name1 = taxonBase1.getName(); |
82 | 81 |
TaxonNameBase<?,?> name2 = taxonBase2.getName(); |
83 |
// System.out.println(name1.getTitleCache() +" : "+ name2.getTitleCache());
|
|
82 |
if (logger.isDebugEnabled()){logger.debug(name1.getTitleCache() +" : "+ name2.getTitleCache());}
|
|
84 | 83 |
|
85 | 84 |
|
86 | 85 |
int compareStatus = compareStatus(name1, name2); |
... | ... | |
132 | 131 |
} |
133 | 132 |
|
134 | 133 |
if (compareResult != 0){ |
135 |
// System.out.println(": " + compareResult);
|
|
134 |
// if (logger.isDebugEnabled()){logger.debug(": " + compareResult);}
|
|
136 | 135 |
return compareResult; |
137 | 136 |
}else{ |
138 | 137 |
//names are uncomparable on name level (except for uuid, id, etc.) |
139 | 138 |
int result = super.compare(taxonBase1, taxonBase2); |
140 |
// System.out.println(": = " + result);
|
|
139 |
if (logger.isDebugEnabled()){logger.debug(": = " + result);}
|
|
141 | 140 |
return result; |
142 | 141 |
} |
143 | 142 |
} |
144 | 143 |
|
145 |
// /** |
|
146 |
// * @param homotypicalGroup |
|
147 |
// * @return |
|
148 |
// */ |
|
149 |
// private TaxonBase<?> getFirstInHomotypicalGroup(HomotypicalGroup homotypicalGroup, Collection<TaxonBase<?>> existing) { |
|
150 |
// List<TaxonBase<?>> candidates = new ArrayList<TaxonBase<?>>(); |
|
151 |
// for (TaxonBase<?> candidate : existing){ |
|
152 |
// if (homotypicalGroup.getTypifiedNames().contains(candidate.getName())){ |
|
153 |
// candidates.add(candidate); |
|
154 |
// } |
|
155 |
// } |
|
156 |
// Collections.sort(candidates, this); |
|
157 |
// return candidates.isEmpty() ? null : candidates.get(0); |
|
158 |
// } |
|
159 |
|
|
160 | 144 |
|
161 | 145 |
/** |
162 | 146 |
* Compare 2 names which have the same basionym. |
... | ... | |
305 | 289 |
} |
306 | 290 |
} |
307 | 291 |
|
292 |
|
|
293 |
// /** |
|
294 |
// * @param homotypicalGroup |
|
295 |
// * @return |
|
296 |
// */ |
|
297 |
// private TaxonBase<?> getFirstInHomotypicalGroup(HomotypicalGroup homotypicalGroup, Collection<TaxonBase<?>> existing) { |
|
298 |
// List<TaxonBase<?>> candidates = new ArrayList<TaxonBase<?>>(); |
|
299 |
// for (TaxonBase<?> candidate : existing){ |
|
300 |
// if (homotypicalGroup.getTypifiedNames().contains(candidate.getName())){ |
|
301 |
// candidates.add(candidate); |
|
302 |
// } |
|
303 |
// } |
|
304 |
// Collections.sort(candidates, this); |
|
305 |
// return candidates.isEmpty() ? null : candidates.get(0); |
|
306 |
// } |
|
307 |
|
|
308 | 308 |
} |
Also available in: Unified diff
Cleanup homotypicGroupComparator