|
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(Collection<? extends E> c)
|
|
void |
clear()
|
|
boolean |
contains(Object o)
|
|
boolean |
containsAll(Collection<?> c)
|
|
boolean |
isEmpty()
|
|
Iterator<E> |
iterator()
|
|
protected boolean |
remove(int index)
Removes the element at the given index from the ordered Set |
|
boolean |
remove(Object o)
|
|
boolean |
removeAll(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(Collection<?> c)
|
|
int |
size()
|
|
Object[] |
toArray()
|
|
|
toArray(T[] a)
|
|
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 Collection<E>add in interface Set<E>public boolean addAll(Collection<? extends E> c)
addAll in interface Collection<E>addAll in interface Set<E>public void clear()
clear in interface Collection<E>clear in interface Set<E>public boolean contains(Object o)
contains in interface Collection<E>contains in interface Set<E>public boolean containsAll(Collection<?> c)
containsAll in interface Collection<E>containsAll in interface Set<E>public boolean isEmpty()
isEmpty in interface Collection<E>isEmpty in interface Set<E>public Iterator<E> iterator()
iterator in interface Iterable<E>iterator in interface Collection<E>iterator in interface Set<E>public boolean remove(Object o)
remove in interface Collection<E>remove in interface Set<E>protected boolean removeEldest()
protected boolean removeNewest()
protected boolean remove(int index)
public boolean removeAll(Collection<?> c)
removeAll in interface Collection<E>removeAll in interface Set<E>public boolean retainAll(Collection<?> c)
retainAll in interface Collection<E>retainAll in interface Set<E>public int size()
size in interface Collection<E>size in interface Set<E>public Object[] toArray()
toArray in interface Collection<E>toArray in interface Set<E>public <T> T[] toArray(T[] a)
toArray in interface Collection<E>toArray in interface Set<E>public String toString()
toString in class Object
|
LimeWire Collection Component API | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||