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

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

Loading…
Cancel
Save