- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我需要按照传递到集合中的顺序恢复 java Set 集合接口(interface)的元素。
java中怎么可能
最佳答案
怎么样LinkedHashSet
?
Hash table and linked list implementation of the Set interface, with predictable iteration order. This implementation differs from HashSet in that it maintains a doubly-linked list running through all of its entries. This linked list defines the iteration ordering, which is the order in which elements were inserted into the set (insertion-order). Note that insertion order is not affected if an element is re-inserted into the set. (An element e is reinserted into a set s if s.add(e) is invoked when s.contains(e) would return true immediately prior to the invocation.)
关于java - 有没有一种方法可以按照传递的顺序从集合中恢复对象?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6030780/
我是一名优秀的程序员,十分优秀!