net.sf.regain.search.results
Class SortingOption
java.lang.Object
net.sf.regain.search.results.SortingOption
- All Implemented Interfaces:
- Comparable
public class SortingOption
- extends Object
- implements Comparable
Holds the sorting for the current search request.
- Author:
- Thomas Tesche: www.thtesche.com
RELEVANCE
public static String RELEVANCE
FILENAME
public static String FILENAME
SIZE
public static String SIZE
MIMETYPE
public static String MIMETYPE
LAST_MODIFIED
public static String LAST_MODIFIED
TITLE
public static String TITLE
PATH
public static String PATH
sortFieldName
private String sortFieldName
reverse
private boolean reverse
sortType
private int sortType
description
private String description
id
private int id
SortingOption
public SortingOption(String orderFromRequest)
- Creates the class from a given sorting option.
- Parameters:
orderFromRequest - the order String from the request. The orderFromRequest
is build from the field and the sorting direction e.g. size_desc.
SortingOption
public SortingOption(String description,
String field,
String order,
int id)
throws RegainException
- Creates the instance from given config entries.
- Parameters:
description - the description shown in the dropdown boxfield - the field name for sortingorder - asc|desc indicates the sorting directionid - the position in the dropdown list
- Throws:
RegainException
isReverse
private boolean isReverse(String option)
setRelevance
private void setRelevance()
getSortFieldName
public String getSortFieldName()
- Returns:
- the sortField
getFieldNameAndOrder
public String getFieldNameAndOrder()
- Returns:
- the sortField plus the sorting direction
isReverse
public boolean isReverse()
- Returns:
- the reverse
getSortType
public int getSortType()
- Returns:
- the sortType
getSortField
public org.apache.lucene.search.SortField getSortField()
getDescription
public String getDescription()
- Returns:
- the description
getId
public int getId()
- Returns:
- the id
compareTo
public int compareTo(Object sortingOption)
throws ClassCastException
- Sort this option against another option.
- Specified by:
compareTo in interface Comparable
- Parameters:
sortingOption -
- Returns:
-
- Throws:
ClassCastException
toString
public String toString()
- Overrides:
toString in class Object
Regain 1.7.7-STABLE, Copyright (C) 2004-2010 Til Schneider, www.murfman.de, Thomas Tesche, www.clustersystems.info