org.apache.jackrabbit.core.query.lucene
Class LengthSortComparator

java.lang.Object
  extended by org.apache.jackrabbit.core.query.lucene.LengthSortComparator
All Implemented Interfaces:
Serializable, org.apache.lucene.search.SortComparatorSource

public class LengthSortComparator
extends Object
implements org.apache.lucene.search.SortComparatorSource

LengthSortComparator implements a sort comparator source that sorts on the length of property values.

See Also:
Serialized Form

Constructor Summary
LengthSortComparator(NamespaceMappings nsMappings)
           
 
Method Summary
 org.apache.lucene.search.ScoreDocComparator newComparator(org.apache.lucene.index.IndexReader reader, String fieldname)
          Creates a new comparator.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LengthSortComparator

public LengthSortComparator(NamespaceMappings nsMappings)
Method Detail

newComparator

public org.apache.lucene.search.ScoreDocComparator newComparator(org.apache.lucene.index.IndexReader reader,
                                                                 String fieldname)
                                                          throws IOException
Creates a new comparator.

Specified by:
newComparator in interface org.apache.lucene.search.SortComparatorSource
Parameters:
reader - the current index reader.
fieldname - the name of the property to sort on. This is the string representation of Name.
Returns:
the score doc comparator.
Throws:
IOException - if an error occurs while reading from the index.


Copyright © 2004-2010 The Apache Software Foundation. All Rights Reserved.