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

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

提交回复
热议问题