|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.ecyrd.jspwiki.util.PageSorter
public class PageSorter
Wrapper class for managing and using the PageNameComparator.
Note - this class is deliberately not null safe. Never call any of the methods with a null argument!
| Field Summary | |
|---|---|
protected static String |
PROP_PAGE_NAME_COMPARATOR
|
| Constructor Summary | |
|---|---|
PageSorter()
Default constructor uses Java "natural" ordering. |
|
PageSorter(Comparator<String> comparator)
Construct with a particular comparator. |
|
| Method Summary | |
|---|---|
int |
compare(Object o1,
Object o2)
Compare two page names (Object version). |
int |
compare(String pageName1,
String pageName2)
Compare two page names (String version). |
int |
compare(WikiPage page1,
WikiPage page2)
Compare two pages (WikiPage version). |
boolean |
equals(Object o)
|
void |
initialize(Properties props)
Called by WikiEngine to initialise this instance. |
void |
sort(List<String> nameList)
Sorts the specified list into ascending order based on the PageNameComparator. |
void |
sort(String[] nameArray)
Sorts the specified array into ascending order based on the PageNameComparator. |
void |
sortPages(List<Object> pageList)
Sorts the specified list into ascending order based on the PageNameComparator. |
void |
sortPages(Object[] pageArray)
Sorts the specified array into ascending order based on the PageNameComparator. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static final String PROP_PAGE_NAME_COMPARATOR
| Constructor Detail |
|---|
public PageSorter()
public PageSorter(Comparator<String> comparator)
comparator - the Comparator to use| Method Detail |
|---|
public int compare(Object o1,
Object o2)
compare in interface ComparatorIllegalArgumentException - if incorrect argument types.Comparator.compare(java.lang.Object, java.lang.Object)
public int compare(String pageName1,
String pageName2)
pageName1 - the first page namepageName2 - the second page name
Comparator.compare(java.lang.Object, java.lang.Object)
public int compare(WikiPage page1,
WikiPage page2)
page1 - the first pagepage2 - the second page
Comparator.compare(java.lang.Object, java.lang.Object)public boolean equals(Object o)
equals in interface Comparatorequals in class Objectpublic void initialize(Properties props)
props - this WikiEngine's properties.public void sort(List<String> nameList)
Collections.sort().
nameList - the page names to be sortedpublic void sort(String[] nameArray)
Arrays.sort().
nameArray - the page names to be sortedpublic void sortPages(List<Object> pageList)
Collections.sort().
pageList - the pages to be sortedpublic void sortPages(Object[] pageArray)
Arrays.sort().
pageArray - the pages to be sorted
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||