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

后端 未结 7 691
抹茶落季
抹茶落季 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:54

    LinkedHashSet is the answer.

    Iteration ordering and uniqueness.

    http://download.oracle.com/javase/6/docs/api/java/util/LinkedHashSet.html

    0 讨论(0)
提交回复
热议问题