T
- public class RandomRemovalList<T> extends Object implements Collection<T>, Iterator<T>
Constructor and Description |
---|
RandomRemovalList() |
RandomRemovalList(Collection<T> objs) |
RandomRemovalList(int capacity) |
Modifier and Type | Method and Description |
---|---|
boolean |
add(T obj) |
boolean |
addAll(Collection<? extends T> c) |
void |
clear() |
boolean |
contains(Object o) |
boolean |
containsAll(Collection<?> c) |
int |
getNumCompactions() |
T |
getRandom() |
boolean |
hasNext() |
boolean |
isEmpty() |
Iterator<T> |
iterator() |
T |
next() |
void |
remove() |
boolean |
remove(Object o) |
boolean |
removeAll(Collection<?> c) |
boolean |
retainAll(Collection<?> c) |
int |
size() |
Object[] |
toArray() |
<E> E[] |
toArray(E[] a) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
equals, hashCode, parallelStream, removeIf, spliterator, stream
forEachRemaining
public static final Random random
public RandomRemovalList()
public RandomRemovalList(int capacity)
public RandomRemovalList(Collection<T> objs)
public boolean add(T obj)
add
in interface Collection<T>
public T getRandom()
public int size()
size
in interface Collection<T>
public boolean isEmpty()
isEmpty
in interface Collection<T>
public int getNumCompactions()
public boolean addAll(Collection<? extends T> c)
addAll
in interface Collection<T>
public void clear()
clear
in interface Collection<T>
public boolean contains(Object o)
contains
in interface Collection<T>
public boolean containsAll(Collection<?> c)
containsAll
in interface Collection<T>
public boolean remove(Object o)
remove
in interface Collection<T>
public boolean removeAll(Collection<?> c)
removeAll
in interface Collection<T>
public boolean retainAll(Collection<?> c)
retainAll
in interface Collection<T>
public Object[] toArray()
toArray
in interface Collection<T>
public <E> E[] toArray(E[] a)
toArray
in interface Collection<T>
Copyright © 2012–2015. All rights reserved.