• <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中有序集的任何实现?

        Any implementation of Ordered Set in Java?(Java中有序集的任何实现?)

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

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  Compiling C++ for the JVM(为 JVM 编译 C++)
                  Compile to java bytecode (without using Java)(编译成java字节码(不使用Java))
                  How to drive C#, C++ or Java compiler to compute 1+2+3+...+1000 at compile time?(如何在编译时驱动 C#、C++ 或 Java 编译器计算 1+2+3+...+1000?)
                  Java ClassLoader: load same class twice(Java ClassLoader:两次加载相同的类)
                  How to debug .class files in ECLIPSE?(如何在 ECLIPSE 中调试 .class 文件?)
                  Java quot;The blank final field may not have been initializedquot; Anonymous Interface vs Lambda Expression(Java“可能尚未初始化空白的最终字段匿名接口与 Lambda 表达式)

                    <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>