|
LimeWire collection component api | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.limewire.collection.LIFOSet<E>
public class LIFOSet<E>
A hash-based Set ordered with the last added element is the
first item in the list.
LIFOSet<String> s = new LIFOSet<String>(1);
s.add("Abby");
s.add("Bob");
s.add("Chris");
s.add("Dan");
s.add("Eric");
s.add("Fred");
System.out.println(s);
Output:
[Fred, Eric, Dan, Chris, Bob, Abby]
| Constructor Summary | |
|---|---|
LIFOSet()
|
|
LIFOSet(int initialCapacity)
|
|
LIFOSet(int initialCapacity,
float loadFactor)
|
|
| Method Summary | ||
|---|---|---|
boolean |
add(E o)
Adds the given element to the head of the set. |
|
boolean |
addAll(java.util.Collection<? extends E> c)
|
|
void |
clear()
|
|
boolean |
contains(java.lang.Object o)
|
|
boolean |
containsAll(java.util.Collection<?> c)
|
|
boolean |
isEmpty()
|
|
java.util.Iterator<E> |
iterator()
|
|
protected boolean |
remove(int index)
Removes the element at the given index from the ordered Set |
|
boolean |
remove(java.lang.Object o)
|
|
boolean |
removeAll(java.util.Collection<?> c)
|
|
protected boolean |
removeEldest()
Removes the first (eldest) element from the ordered set |
|
protected boolean |
removeNewest()
Removes the last (newest) element from the ordered set |
|
boolean |
retainAll(java.util.Collection<?> c)
|
|
int |
size()
|
|
java.lang.Object[] |
toArray()
|
|
|
toArray(T[] a)
|
|
java.lang.String |
toString()
|
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface java.util.Set |
|---|
equals, hashCode |
| Constructor Detail |
|---|
public LIFOSet()
public LIFOSet(int initialCapacity)
public LIFOSet(int initialCapacity,
float loadFactor)
| Method Detail |
|---|
public boolean add(E o)
add in interface java.util.Collection<E>add in interface java.util.Set<E>public boolean addAll(java.util.Collection<? extends E> c)
addAll in interface java.util.Collection<E>addAll in interface java.util.Set<E>public void clear()
clear in interface java.util.Collection<E>clear in interface java.util.Set<E>public boolean contains(java.lang.Object o)
contains in interface java.util.Collection<E>contains in interface java.util.Set<E>public boolean containsAll(java.util.Collection<?> c)
containsAll in interface java.util.Collection<E>containsAll in interface java.util.Set<E>public boolean isEmpty()
isEmpty in interface java.util.Collection<E>isEmpty in interface java.util.Set<E>public java.util.Iterator<E> iterator()
iterator in interface java.lang.Iterable<E>iterator in interface java.util.Collection<E>iterator in interface java.util.Set<E>public boolean remove(java.lang.Object o)
remove in interface java.util.Collection<E>remove in interface java.util.Set<E>protected boolean removeEldest()
protected boolean removeNewest()
protected boolean remove(int index)
public boolean removeAll(java.util.Collection<?> c)
removeAll in interface java.util.Collection<E>removeAll in interface java.util.Set<E>public boolean retainAll(java.util.Collection<?> c)
retainAll in interface java.util.Collection<E>retainAll in interface java.util.Set<E>public int size()
size in interface java.util.Collection<E>size in interface java.util.Set<E>public java.lang.Object[] toArray()
toArray in interface java.util.Collection<E>toArray in interface java.util.Set<E>public <T> T[] toArray(T[] a)
toArray in interface java.util.Collection<E>toArray in interface java.util.Set<E>public java.lang.String toString()
toString in class java.lang.Object
|
LimeWire collection component api | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||