程序包 org.antlr.misc
类 OrderedHashSet<T>
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractSet<E>
-
- java.util.HashSet<E>
-
- java.util.LinkedHashSet<T>
-
- 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.- 另请参阅:
- 序列化表格
-
-
构造器概要
构造器 构造器 说明 OrderedHashSet()
-
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 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()
-
-
-
字段详细资料
-
elements
protected java.util.List<T> elements
Track the elements as they are added to the set
-
-
方法详细资料
-
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.
-
remove
public boolean remove(java.lang.Object o)
-
clear
public void clear()
-
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()
-
toArray
public java.lang.Object[] toArray()
-
size
public int size()
-
toString
public java.lang.String toString()
- 覆盖:
toString
在类中java.util.AbstractCollection<T>
-
-