small fix on tag comporator functions

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@4794 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
apfelmaennchen 17 years ago
parent dd75b3cabc
commit 2113672bf2

@ -434,9 +434,12 @@ public class bookmarksDB {
public Iterator<Tag> getTagIterator(boolean priv, int comp, int max){
if (max==SHOW_ALL)
return getTagIterator(priv, comp);
Iterator<Tag> it = getTagIterator(priv, comp);
TreeSet<Tag> set=new TreeSet<Tag>(new tagComparator());
return getTagIterator(priv, comp);
Iterator<Tag> it = getTagIterator(priv, SORT_SIZE);
Comparator<Tag> c;
if (comp == SORT_SIZE) c = new tagSizeComparator();
else c = new tagComparator();
TreeSet<Tag> set=new TreeSet<Tag>(c);
int count = 0;
while (it.hasNext() && count<=max) {
set.add(it.next());
@ -446,7 +449,7 @@ public class bookmarksDB {
}
public Iterator<Tag> getTagIterator(String tagName, boolean priv){
return getTagIterator(tagName, priv, 1);
return getTagIterator(tagName, priv, SORT_ALPHA);
}
public Iterator<Tag> getTagIterator(String tagName, boolean priv, int comp){
@ -476,8 +479,11 @@ public class bookmarksDB {
public Iterator<Tag> getTagIterator(String tagName, boolean priv, int comp, int max){
if (max==SHOW_ALL)
return getTagIterator(priv, comp);
Iterator<Tag> it = getTagIterator(tagName, priv, comp);
TreeSet<Tag> set=new TreeSet<Tag>(new tagComparator());
Iterator<Tag> it = getTagIterator(tagName, priv, SORT_SIZE);
Comparator<Tag> c;
if (comp == SORT_SIZE) c = new tagSizeComparator();
else c = new tagComparator();
TreeSet<Tag> set=new TreeSet<Tag>(c);
int count = 0;
while (it.hasNext() && count<=max) {
set.add(it.next());

Loading…
Cancel
Save