T
- the typepublic static class QueryResultSet.ScoreComparator<T extends Publication> extends BasicComparator<T>
Comparator
compares two Object
s using a score
retrieved from a map of Object
to float
. MdateComparator
. Comparator
says see the
compare(Object, Object)
method.Modifier and Type | Field and Description |
---|---|
static java.lang.String |
PARENT_COMPARATOR |
static java.lang.String |
QUERY_RESULT_SET |
channel, contextMap, jcmsContext, language, locale
Constructor and Description |
---|
ScoreComparator()
Initialize a
ScoreComparator from the contextual information
retrieved through ComparatorManager parameter |
ScoreComparator(QueryResultSet resultSet,
java.util.Comparator parentComparator)
Initialize a
ScoreComparator using the given parent
Comparator , if null, default with MdateComparator . |
Modifier and Type | Method and Description |
---|---|
int |
compare(T o1,
T o2)
Compare two Object using their score from the QueryResulSet.
|
compareDate
public static final java.lang.String PARENT_COMPARATOR
public static final java.lang.String QUERY_RESULT_SET
public ScoreComparator()
ScoreComparator
from the contextual information
retrieved through ComparatorManager parameter
Comparator
, is retrieved using attribute
PARENT_COMPARATOR
, if null, default with MdateComparator
.QueryResultSet
, is retrieved using attribute
QUERY_RESULT_SET
, must not be null.java.lang.IllegalArgumentException
- if QueryResultSet is nullpublic ScoreComparator(QueryResultSet resultSet, java.util.Comparator parentComparator)
ScoreComparator
using the given parent
Comparator
, if null, default with MdateComparator
.resultSet
- the QueryResultSet
from which to retrieve
score of each Publication
.parentComparator
- the Comparator
to use when score of
compared Object
are identical.java.lang.IllegalArgumentException
- if QueryResultSet is nullpublic int compare(T o1, T o2)
compare
in interface java.util.Comparator<T extends Publication>
compare
in class BasicStorable.CdateComparator<T extends Publication>
Copyright © 2001-2017 Jalios SA. All Rights Reserved.