[jboss-dev-forums] [Design of JBossCache] - JBCACHE-166 - TreeSet/Map, LinkedHashMap
genman
do-not-reply at jboss.com
Wed Nov 8 18:05:24 EST 2006
What would be ideal for implementing ordered values for POJOs would be to able to create a org.jboss.Cache.Node with an ordered implementation for the children nodes.
In particular, it might be nice to add this method to Node:
| interface Node {
| // ...
| void setChildrenOrdering(Comparator c);
| }
|
By default, no ordering (ConcurrentReaderHashMap) would be fine. I'm not sure the alternative in the sorted case, however. It obviously wouldn't be as efficient. The edu.oswego "SyncSortedSet" might be okay, although iteration over children could then result in ConcurrentModificationExceptions.
This would be very useful for creating a POJO LinkedList as well.
This might be useful outside of POJO land as well, especially for users who want an ordered tree.
Without this, I don't see how you could create an optimal POJO SortedSet.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3984337#3984337
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3984337
More information about the jboss-dev-forums
mailing list