edu.internet2.middleware.grouper.internal.dao
Class QuerySort

java.lang.Object
  extended by edu.internet2.middleware.grouper.internal.dao.QuerySort

public class QuerySort
extends Object


Constructor Summary
QuerySort(String column, boolean ascending)
           
 
Method Summary
 void addSort(String column, boolean ascending)
           
static QuerySort asc(String column)
          shortcut for ascending col
 void assignSort(String column, boolean ascending)
           
static QuerySort desc(String column)
          shortcut for descending col
 int getMaxCols()
          max cols to store
 List<QuerySortField> getQuerySortFields()
          list of sort fields...
 boolean isSorting()
          see if we are sorting
 void setMaxCols(int maxCols)
          max cols to store
 String sortString(boolean includePreSpaceIfSorting)
          get the sort string based on the cols, add space before perhaps
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

QuerySort

public QuerySort(String column,
                 boolean ascending)
Parameters:
column -
ascending -
Method Detail

getQuerySortFields

public List<QuerySortField> getQuerySortFields()
list of sort fields... generally it would just be one

Returns:
the sort fields

getMaxCols

public int getMaxCols()
max cols to store

Returns:
max cols

setMaxCols

public void setMaxCols(int maxCols)
max cols to store

Parameters:
maxCols -

asc

public static QuerySort asc(String column)
shortcut for ascending col

Parameters:
column -
Returns:
the query sort

desc

public static QuerySort desc(String column)
shortcut for descending col

Parameters:
column -
Returns:
the query sort

assignSort

public void assignSort(String column,
                       boolean ascending)
Parameters:
column -
ascending -

addSort

public void addSort(String column,
                    boolean ascending)
Parameters:
column -
ascending -

isSorting

public boolean isSorting()
see if we are sorting

Returns:
true if sorting

sortString

public String sortString(boolean includePreSpaceIfSorting)
get the sort string based on the cols, add space before perhaps

Parameters:
includePreSpaceIfSorting - if we should add a whitespace char before sortstring if it exists
Returns:
the sort string