public class Sort extends Object implements Cloneable, Serializable
Modifier and Type | Class and Description |
---|---|
static class |
Sort.NullSortOrder
Sort order for NULL values.
|
static class |
Sort.SortOrder
Contains the possible sort order values
|
Modifier and Type | Field and Description |
---|---|
static Sort.SortOrder |
ASC
Ascending Sort Order.
|
static Sort.SortOrder |
DEFAULT_ORDER
Default Sort Order.
|
static Sort.SortOrder |
DESC
Descending Sort Order.
|
protected FieldExpression |
field
The field being sorted on.
|
protected Sort.NullSortOrder |
nullOrder
The null sort order
|
static Sort.NullSortOrder |
NULLS_FIRST
Null sort order for ording nulls prior to all other values.
|
static Sort.NullSortOrder |
NULLS_LAST
Null sort order for ording nulls after all other values.
|
protected Sort.SortOrder |
order
The sort order
|
Constructor and Description |
---|
Sort(FieldExpression field) |
Sort(FieldExpression field,
Sort.SortOrder order) |
Sort(FieldExpression field,
Sort.SortOrder order,
Sort.NullSortOrder nullOrder) |
Sort(String name)
Sort descending by field
name . |
Sort(String field,
Sort.SortOrder order)
Sort by field
name according to order . |
Sort(String field,
Sort.SortOrder order,
Sort.NullSortOrder nullOrder)
Sort by
field according to order . |
Modifier and Type | Method and Description |
---|---|
Sort |
clone() |
boolean |
equals(Object other) |
FieldExpression |
getField()
Get the field to sort by.
|
String |
getFieldName() |
Sort.NullSortOrder |
getNullOrder()
Get the order for sorting null values.
|
Sort.SortOrder |
getOrder()
Get the order to sort by.
|
int |
hashCode() |
boolean |
isAscending()
true if sort order is Sort.SortOrder.ASCENDING . |
boolean |
isDescending()
true if sort order is Sort.SortOrder.DESCENDING . |
boolean |
isRelevancySort()
true if this Sort by document score (sorting by field FieldNames.SCORE ) |
static Sort |
parseSort(StringParser reader)
Parse a Sort.
|
static Sort |
relevancySort()
Factory method for creating a sort according to score, descending.
|
void |
setField(FieldExpression value)
Set the field to sort by.
|
void |
setField(String value)
Set the field to sort by.
|
void |
setNullOrder(Sort.NullSortOrder value)
Set the order for sorting null values.
|
void |
setOrder(Sort.SortOrder order)
Set the order to sort by.
|
String |
toString() |
static Sort |
valueOf(String value)
Parse a
Sort . |
public static final Sort.SortOrder DEFAULT_ORDER
public static final Sort.SortOrder ASC
public static final Sort.SortOrder DESC
public static final Sort.NullSortOrder NULLS_FIRST
public static final Sort.NullSortOrder NULLS_LAST
protected FieldExpression field
protected Sort.SortOrder order
protected Sort.NullSortOrder nullOrder
public Sort(String name)
name
.public Sort(String field, Sort.SortOrder order)
name
according to order
.public Sort(FieldExpression field)
public Sort(FieldExpression field, Sort.SortOrder order)
public Sort(String field, Sort.SortOrder order, Sort.NullSortOrder nullOrder)
field
according to order
.public Sort(FieldExpression field, Sort.SortOrder order, Sort.NullSortOrder nullOrder)
public String getFieldName()
public FieldExpression getField()
public void setField(String value)
public void setField(FieldExpression value)
public boolean isRelevancySort()
true
if this Sort by document score (sorting by field FieldNames.SCORE
)public Sort.SortOrder getOrder()
public void setOrder(Sort.SortOrder order)
public Sort.NullSortOrder getNullOrder()
public void setNullOrder(Sort.NullSortOrder value)
public boolean isAscending()
true
if sort order is Sort.SortOrder.ASCENDING
.public boolean isDescending()
true
if sort order is Sort.SortOrder.DESCENDING
.public static Sort relevancySort()
public static Sort parseSort(StringParser reader)
Copyright © 2018 Attivio, Inc. All Rights Reserved.
PATENT NOTICE: Attivio, Inc. Software Related Patents. With respect to the Attivio software product(s) being used, the following patents apply: Querying Joined Data Within A Search Engine Index: United States Patent No.(s): 8,073,840. Ordered Processing of Groups of Messages: U.S. Patent No.(s) 8,495,656. Signal processing approach to sentiment analysis for entities in documents: U.S. Patent No.(s) 8,725,494. Other U.S. and International Patents Pending.