public class OwSort extends Object
Sorts contain a list of sort criteria.
Sort is used with OwObjectList.sort(...) and OwNetwork.doSearch(...) Function.
Automatically keeps the size of the list to a specified maximum, when using addCriteria(...).
To be extended with the specific DMS system.
Alfresco Workdesk
Copyright (c) Alfresco Software, Inc.
All rights reserved.
For licensing information read the license.txt file or
go to: http://wiki.alfresco.com
Modifier and Type | Class and Description |
---|---|
static class |
OwSort.OwSortCriteria
Sort criteria tuple containing property and order direction.
|
Modifier and Type | Field and Description |
---|---|
protected boolean |
m_fDefaultAsc
default sort order for new criteria
|
protected int |
m_iMax
the maximum number of sort criteria in the sort list default is 1
|
protected LinkedList<OwSort.OwSortCriteria> |
m_SortList
list containing the sort OwSortCriteria
|
Constructor and Description |
---|
OwSort()
constructs empty sort criteria list with maxsize = 1 and default sort order asc = true
|
OwSort(int iMaxSize_p,
boolean fAsc_p)
constructs empty sort criteria list with specified maxsize
if the number of sort criteria exceeds the maximum value, the first sort criteria gets removed
|
Modifier and Type | Method and Description |
---|---|
void |
addCriteria(OwSort.OwSortCriteria criteria_p)
add a sort criteria to the sort
|
OwSort.OwSortCriteria |
getCriteria(String strPropertyName_p)
get the specified criteria
|
Collection<OwSort.OwSortCriteria> |
getCriteriaCollection()
get a collection over the criteria.
|
boolean |
getDefaultAsc()
get default sort order for new criteria
|
OwSort.OwSortCriteria |
getLastCriteria()
get the last criteria, i.e.
|
int |
getMaxSize()
get the maximum number of sort criteria in the sort list
|
Iterator<OwSort.OwSortCriteria> |
getPrioritizedIterator()
Returns an Iterator with priority specific order of the OwSortCriteria,
beginning with the highest down to lowest.
|
int |
getPriority(OwSort.OwSortCriteria criteria_p)
get the priority of the criteria, last criteria has highest priority
|
int |
getSize()
get the size of the criteria list
|
protected void |
reduceToMaxSize()
Will remove the first entries until it is equal
getMaxSize() . |
void |
removeCriteria(String strPropertyName_p)
remove the specified criteria
|
void |
setCriteria(String strPropertyName_p,
boolean fAsc_p)
toggle existing criteria or add a criteria to the sort list if it does not yet exist
if the number of sort criteria exceeds the maximum value, the first sort criteria gets removed
|
void |
setMaxSize(int iMax_p)
set the maximum number of sort criteria in the sort list.
|
void |
toggleCriteria(String strPropertyName_p)
toggle existing criteria or add a criteria to the sortlist if it does not yet exist
if the number of sort criteria exceeds the maximum value, the first sort criteria gets removed
|
String |
toString() |
protected LinkedList<OwSort.OwSortCriteria> m_SortList
protected int m_iMax
protected boolean m_fDefaultAsc
public OwSort()
public OwSort(int iMaxSize_p, boolean fAsc_p)
iMaxSize_p
- the maximum number of sort criteria in the sort list.fAsc_p
- sort order true = ascending, false = descendingpublic int getMaxSize()
public boolean getDefaultAsc()
public void setMaxSize(int iMax_p)
iMax_p
- maximum number of sort criteriapublic int getSize()
public Collection<OwSort.OwSortCriteria> getCriteriaCollection()
public void addCriteria(OwSort.OwSortCriteria criteria_p)
criteria_p
- OwSortCriteria to addpublic void removeCriteria(String strPropertyName_p)
strPropertyName_p
- Property name or criteria to removepublic OwSort.OwSortCriteria getLastCriteria()
public OwSort.OwSortCriteria getCriteria(String strPropertyName_p)
strPropertyName_p
- Property name to sort forpublic void toggleCriteria(String strPropertyName_p)
strPropertyName_p
- Property name to sort forpublic int getPriority(OwSort.OwSortCriteria criteria_p)
criteria_p
- public void setCriteria(String strPropertyName_p, boolean fAsc_p)
strPropertyName_p
- Property name to sort forpublic Iterator<OwSort.OwSortCriteria> getPrioritizedIterator()
protected void reduceToMaxSize()
getMaxSize()
.
If it current size is smaller nothing will be processed.Copyright © 2014 Alfresco Business Solutions. All Rights Reserved.