Is there an insertion order preserving Set that also implements List?

后端 未结 7 729
抹茶落季
抹茶落季 2020-12-01 03:50

I\'m trying to find an implementation of java.util.List and java.util.Set at the same time in Java. I want this class to allow only unique elements

7条回答
  •  醉话见心
    2020-12-01 04:40

    If you won't limit yourself to JDK 6 you could use Apache common collections library which offers exact match for your need - ListOrderedSet. It's like List and Set combined together :)

提交回复
热议问题