org.limewire.collection
Class RandomOrderHashSet<T>
java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractSet<E>
java.util.HashSet<E>
org.limewire.collection.FixedSizeArrayHashSet<T>
org.limewire.collection.RandomOrderHashSet<T>
- All Implemented Interfaces:
- Serializable, Cloneable, Iterable<T>, Collection<T>, RandomAccess, Set<T>, RandomAccessCollection<T>
public class RandomOrderHashSet<T>
- extends FixedSizeArrayHashSet<T>
A variant of FixedSizeArrayHashSet that allows iterations over
its elements in random order.
LinkedList<Integer> linkedlist1 = new LinkedList<Integer>();
for(int i = 0; i < 5; i++)
linkedlist1.add(i);
RandomOrderHashSet<Integer> rohs = new RandomOrderHashSet<Integer>(linkedlist1);
System.out.println(rohs);
Random Output:
[1, 3, 0, 2, 4]
- See Also:
- Serialized Form
RandomOrderHashSet
public RandomOrderHashSet(Collection<? extends T> c)
RandomOrderHashSet
public RandomOrderHashSet(int capacity,
Collection<? extends T> c)
RandomOrderHashSet
public RandomOrderHashSet(int maxSize,
int initialCapacity,
float loadFactor)
RandomOrderHashSet
public RandomOrderHashSet(int initialCapacity)
iterator
public Iterator<T> iterator()
- Specified by:
iterator in interface Iterable<T>- Specified by:
iterator in interface Collection<T>- Specified by:
iterator in interface Set<T>- Overrides:
iterator in class FixedSizeArrayHashSet<T>
Copyright © 2009 Lime Wire LLC. All Rights Reserved.