程序包 org.antlr.misc

类 OrderedHashSet<T>

  • 所有已实现的接口:
    java.io.Serializable, java.lang.Cloneable, java.lang.Iterable<T>, java.util.Collection<T>, java.util.Set<T>

    public class OrderedHashSet<T>
    extends java.util.LinkedHashSet<T>
    A HashMap that remembers the order that the elements were added. You can alter the ith element with set(i,value) too :) Unique list. I need the replace/set-element-i functionality so I'm subclassing OrderedHashSet.
    另请参阅:
    序列化表格
    • 字段概要

      字段 
      修饰符和类型 字段 说明
      protected java.util.List<T> elements
      Track the elements as they are added to the set
    • 方法概要

      所有方法 实例方法 具体方法 
      修饰符和类型 方法 说明
      boolean add​(T value)
      Add a value to list; keep in hashtable for consistency also; Key is object itself.
      void clear()  
      java.util.List<T> elements()
      Return the List holding list of table elements.
      T get​(int i)  
      java.util.Iterator<T> iterator()  
      boolean remove​(java.lang.Object o)  
      T set​(int i, T value)
      Replace an existing value with a new value; updates the element list and the hash table, but not the key as that has not changed.
      int size()  
      java.lang.Object[] toArray()  
      java.lang.String toString()  
      • 从类继承的方法 java.util.LinkedHashSet

        spliterator
      • 从类继承的方法 java.util.HashSet

        clone, contains, isEmpty
      • 从类继承的方法 java.util.AbstractSet

        equals, hashCode, removeAll
      • 从类继承的方法 java.util.AbstractCollection

        addAll, containsAll, retainAll, toArray
      • 从类继承的方法 java.lang.Object

        finalize, getClass, notify, notifyAll, wait, wait, wait
      • 从接口继承的方法 java.util.Collection

        parallelStream, removeIf, stream, toArray
      • 从接口继承的方法 java.lang.Iterable

        forEach
      • 从接口继承的方法 java.util.Set

        addAll, contains, containsAll, equals, hashCode, isEmpty, removeAll, retainAll, toArray
    • 字段详细资料

      • elements

        protected java.util.List<T> elements
        Track the elements as they are added to the set
    • 构造器详细资料

      • OrderedHashSet

        public OrderedHashSet()
    • 方法详细资料

      • get

        public T get​(int i)
      • set

        public T set​(int i,
                     T value)
        Replace an existing value with a new value; updates the element list and the hash table, but not the key as that has not changed.
      • add

        public boolean add​(T value)
        Add a value to list; keep in hashtable for consistency also; Key is object itself. Good for say asking if a certain string is in a list of strings.
        指定者:
        add 在接口中 java.util.Collection<T>
        指定者:
        add 在接口中 java.util.Set<T>
        覆盖:
        add 在类中 java.util.HashSet<T>
      • remove

        public boolean remove​(java.lang.Object o)
        指定者:
        remove 在接口中 java.util.Collection<T>
        指定者:
        remove 在接口中 java.util.Set<T>
        覆盖:
        remove 在类中 java.util.HashSet<T>
      • clear

        public void clear()
        指定者:
        clear 在接口中 java.util.Collection<T>
        指定者:
        clear 在接口中 java.util.Set<T>
        覆盖:
        clear 在类中 java.util.HashSet<T>
      • elements

        public java.util.List<T> elements()
        Return the List holding list of table elements. Note that you are NOT getting a copy so don't write to the list.
      • iterator

        public java.util.Iterator<T> iterator()
        指定者:
        iterator 在接口中 java.util.Collection<T>
        指定者:
        iterator 在接口中 java.lang.Iterable<T>
        指定者:
        iterator 在接口中 java.util.Set<T>
        覆盖:
        iterator 在类中 java.util.HashSet<T>
      • toArray

        public java.lang.Object[] toArray()
        指定者:
        toArray 在接口中 java.util.Collection<T>
        指定者:
        toArray 在接口中 java.util.Set<T>
        覆盖:
        toArray 在类中 java.util.AbstractCollection<T>
      • size

        public int size()
        指定者:
        size 在接口中 java.util.Collection<T>
        指定者:
        size 在接口中 java.util.Set<T>
        覆盖:
        size 在类中 java.util.HashSet<T>
      • toString

        public java.lang.String toString()
        覆盖:
        toString 在类中 java.util.AbstractCollection<T>