> > + private final FMSBoard self = this; > > + /* > > + * FIXME: We need a datastructure which is a HashTable and a > > +LinkedList > which is sorted by Date of the messages. > > + * java.util.LinkedHashSet is the right thing but it does not > > +provide > sorting. > > + */ > > + private final Hashtable<FreenetURI, FMSMessage> mMessages = new > HashTable<FreenetURI, FMSMessage>(); > > + private final LinkedList<FMSMessage> mMessagesSorted = new > LinkedList<FMSMessage>(); > > Does LinkedList? Only because you add stuff at the right end. > LinkedHashSet > can do the same thing, and can be used to implement LRU's for > example. Read > the docs more carefully.
LinkedList of course has no HashTable. And LinkedHashSet is a child class of HashSet, not List. Therefore, Collections.sort() won't work on it because it only sorts Lists. I am using freenet.support.UpdatableSortedLinkedListWithForeignIndex. If anyone else knows something better, please tell me. _______________________________________________ Devl mailing list [email protected] http://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl
