• <tfoot id='Qd6GR'></tfoot>

    1. <small id='Qd6GR'></small><noframes id='Qd6GR'>

      <i id='Qd6GR'><tr id='Qd6GR'><dt id='Qd6GR'><q id='Qd6GR'><span id='Qd6GR'><b id='Qd6GR'><form id='Qd6GR'><ins id='Qd6GR'></ins><ul id='Qd6GR'></ul><sub id='Qd6GR'></sub></form><legend id='Qd6GR'></legend><bdo id='Qd6GR'><pre id='Qd6GR'><center id='Qd6GR'></center></pre></bdo></b><th id='Qd6GR'></th></span></q></dt></tr></i><div id='Qd6GR'><tfoot id='Qd6GR'></tfoot><dl id='Qd6GR'><fieldset id='Qd6GR'></fieldset></dl></div>
    2. <legend id='Qd6GR'><style id='Qd6GR'><dir id='Qd6GR'><q id='Qd6GR'></q></dir></style></legend>
        <bdo id='Qd6GR'></bdo><ul id='Qd6GR'></ul>
      1. Java中有序集的任何实现?

        时间:2023-10-13

        <legend id='MnA9y'><style id='MnA9y'><dir id='MnA9y'><q id='MnA9y'></q></dir></style></legend>
      2. <tfoot id='MnA9y'></tfoot>
              <tbody id='MnA9y'></tbody>

                <small id='MnA9y'></small><noframes id='MnA9y'>

              1. <i id='MnA9y'><tr id='MnA9y'><dt id='MnA9y'><q id='MnA9y'><span id='MnA9y'><b id='MnA9y'><form id='MnA9y'><ins id='MnA9y'></ins><ul id='MnA9y'></ul><sub id='MnA9y'></sub></form><legend id='MnA9y'></legend><bdo id='MnA9y'><pre id='MnA9y'><center id='MnA9y'></center></pre></bdo></b><th id='MnA9y'></th></span></q></dt></tr></i><div id='MnA9y'><tfoot id='MnA9y'></tfoot><dl id='MnA9y'><fieldset id='MnA9y'></fieldset></dl></div>
                  <bdo id='MnA9y'></bdo><ul id='MnA9y'></ul>
                  本文介绍了Java中有序集的任何实现?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  如果有人熟悉 Objective-C,那么有一个名为 NSOrderedSet 充当 Set,其项目可以作为 Array 的项目访问.

                  If anybody is familiar with Objective-C there is a collection called NSOrderedSet that acts as Set and its items can be accessed as an Array's ones.

                  Java 中有这样的东西吗?

                  Is there anything like this in Java?

                  我听说有一个集合叫做 LinkedHashMap,但我还没有找到类似的集合.

                  I've heard there is a collection called LinkedHashMap, but I haven't found anything like it for a set.

                  推荐答案

                  看看LinkedHashSet 类

                  来自 Java 文档:

                  From Java doc:

                  Set 接口的哈希表和链表实现,具有可预测的迭代顺序.此实现与 HashSet 的不同之处在于它维护一个双向链表,该列表贯穿其所有条目.这个链表定义了迭代顺序,元素被插入到集合中的顺序(insertion-order).请注意,如果将元素重新插入集合中,插入顺序不会受到影响.(如果在调用 s.contains(e) 将在调用之前立即返回 true 时调用 s.add(e),则元素 e 将重新插入到集合 s 中.).

                  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中有序集的任何实现?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                    <small id='TluZk'></small><noframes id='TluZk'>

                      <tbody id='TluZk'></tbody>
                      <bdo id='TluZk'></bdo><ul id='TluZk'></ul>

                      <tfoot id='TluZk'></tfoot>
                      • <legend id='TluZk'><style id='TluZk'><dir id='TluZk'><q id='TluZk'></q></dir></style></legend>
                        <i id='TluZk'><tr id='TluZk'><dt id='TluZk'><q id='TluZk'><span id='TluZk'><b id='TluZk'><form id='TluZk'><ins id='TluZk'></ins><ul id='TluZk'></ul><sub id='TluZk'></sub></form><legend id='TluZk'></legend><bdo id='TluZk'><pre id='TluZk'><center id='TluZk'></center></pre></bdo></b><th id='TluZk'></th></span></q></dt></tr></i><div id='TluZk'><tfoot id='TluZk'></tfoot><dl id='TluZk'><fieldset id='TluZk'></fieldset></dl></div>