Package org.openqreg.bean

Examples of org.openqreg.bean.SortOrder


   *            : a string with the name of the sortlist that is to be stored
   * @param sortList
   *            : a list containing a sort order
   */
  protected void addSortOrderList(String sortListName, String sortList[]) {
    SortOrder tempList = new SortOrder();
    tempList.setName(new String(sortListName));
    tempList.setSortList(sortList);
    tempList.setLastPrefered(sortList[0]);
    tempList.setAscDesc("DESC");
    sortListKeeper.put(sortListName, tempList);
  }
View Full Code Here


   *            : a string with the name of the sortlist that is to be
   *            returned
   * @return String: a string as a piece of an sql statement
   */
  protected String getSortOrder(String sortList) {
    SortOrder tempList = sortListKeeper.get(sortList);
    StringBuffer back = new StringBuffer(" ORDER BY ");
    back.append(tempList.getLastPrefered());
    back.append(" " + tempList.getAscDesc());
    for (int r = 0; r < tempList.getSortList().length; r++) {
      if (!tempList.getLastPrefered().equals(tempList.getSortList()[r])) {
        back.append(", " + tempList.getSortList()[r] + " "
            + tempList.getAscDesc());
      }
    }
    back.append(" ");
    return back.toString();
  }
View Full Code Here

  }

  protected void setStandardSortOrder(User user) {
    // Set user's default sortlist from dispatcher's
    // list
    SortOrder sortOrder;
    TreeMap<String, SortOrder> dispSortOrder = getSortListKeeper(); // Sort
    // order list from the Dispatcher
    if (null == user.getSortListKeeper()) {
      user.setSortListKeeper(new TreeMap<String, SortOrder>());
    }
    TreeMap<String, SortOrder> userSortOrder = user.getSortListKeeper(); // The
    // user's sort order
    for (Iterator<SortOrder> i = dispSortOrder.values().iterator(); i
        .hasNext();) {
      sortOrder = i.next();
      userSortOrder.put(sortOrder.getName(), sortOrder.copy());
    }
  }
View Full Code Here

TOP

Related Classes of org.openqreg.bean.SortOrder

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.