|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.AbstractCollection<E>
java.util.AbstractQueue<A>
com.sun.tools.javac.util.ListBuffer<A>
public class ListBuffer<A>
A class for constructing lists by appending elements. Modelled after java.lang.StringBuffer.
This is NOT part of any API supported by Sun Microsystems. If you write code that depends on this, you do so at your own risk. This code and its internal interfaces are subject to change or deletion without notice.
Field Summary | |
---|---|
int |
count
The number of element in this buffer. |
List<A> |
elems
The list of elements of this buffer. |
List<A> |
last
A pointer pointing to the last, sentinel element of `elems'. |
boolean |
shared
Has a list been created from this buffer yet? |
Constructor Summary | |
---|---|
ListBuffer()
Create a new initially empty list buffer. |
Method Summary | ||
---|---|---|
boolean |
add(A a)
|
|
boolean |
addAll(java.util.Collection<? extends A> c)
|
|
ListBuffer<A> |
append(A x)
Append an element to buffer. |
|
ListBuffer<A> |
appendArray(A[] xs)
Append all elements in an array to buffer. |
|
ListBuffer<A> |
appendList(List<A> xs)
Append all elements in a list to buffer. |
|
ListBuffer<A> |
appendList(ListBuffer<A> xs)
Append all elements in a list to buffer. |
|
void |
clear()
|
|
boolean |
contains(java.lang.Object x)
Does the list contain the specified element? |
|
boolean |
containsAll(java.util.Collection<?> c)
|
|
private void |
copy()
Copy list and sets last. |
|
A |
first()
The first element in this buffer. |
|
boolean |
isEmpty()
Is buffer empty? |
|
java.util.Iterator<A> |
iterator()
An enumeration of all elements in this buffer. |
|
static
|
lb()
|
|
int |
length()
Return the number of elements in this buffer. |
|
A |
next()
Return first element in this buffer and remove |
|
boolean |
nonEmpty()
Is buffer not empty? |
|
static
|
of(T x)
|
|
boolean |
offer(A a)
|
|
A |
peek()
|
|
A |
poll()
|
|
ListBuffer<A> |
prepend(A x)
Prepend an element to buffer. |
|
boolean |
remove(java.lang.Object o)
|
|
boolean |
removeAll(java.util.Collection<?> c)
|
|
boolean |
retainAll(java.util.Collection<?> c)
|
|
int |
size()
|
|
java.lang.Object[] |
toArray()
|
|
|
toArray(T[] vec)
Convert buffer to an array |
|
List<A> |
toList()
Convert buffer to a list of all its elements. |
Methods inherited from class java.util.AbstractQueue |
---|
element, remove |
Methods inherited from class java.util.AbstractCollection |
---|
toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.util.Collection |
---|
equals, hashCode |
Field Detail |
---|
public List<A> elems
public List<A> last
public int count
public boolean shared
Constructor Detail |
---|
public ListBuffer()
Method Detail |
---|
public static <T> ListBuffer<T> lb()
public static <T> ListBuffer<T> of(T x)
public final void clear()
clear
in interface java.util.Collection<A>
clear
in class java.util.AbstractQueue<A>
public int length()
public int size()
size
in interface java.util.Collection<A>
size
in class java.util.AbstractCollection<A>
public boolean isEmpty()
isEmpty
in interface java.util.Collection<A>
isEmpty
in class java.util.AbstractCollection<A>
public boolean nonEmpty()
private void copy()
public ListBuffer<A> prepend(A x)
public ListBuffer<A> append(A x)
public ListBuffer<A> appendList(List<A> xs)
public ListBuffer<A> appendList(ListBuffer<A> xs)
public ListBuffer<A> appendArray(A[] xs)
public List<A> toList()
public boolean contains(java.lang.Object x)
contains
in interface java.util.Collection<A>
contains
in class java.util.AbstractCollection<A>
public <T> T[] toArray(T[] vec)
toArray
in interface java.util.Collection<A>
toArray
in class java.util.AbstractCollection<A>
public java.lang.Object[] toArray()
toArray
in interface java.util.Collection<A>
toArray
in class java.util.AbstractCollection<A>
public A first()
public A next()
public java.util.Iterator<A> iterator()
iterator
in interface java.lang.Iterable<A>
iterator
in interface java.util.Collection<A>
iterator
in class java.util.AbstractCollection<A>
public boolean add(A a)
add
in interface java.util.Collection<A>
add
in class java.util.AbstractQueue<A>
public boolean remove(java.lang.Object o)
remove
in interface java.util.Collection<A>
remove
in class java.util.AbstractCollection<A>
public boolean containsAll(java.util.Collection<?> c)
containsAll
in interface java.util.Collection<A>
containsAll
in class java.util.AbstractCollection<A>
public boolean addAll(java.util.Collection<? extends A> c)
addAll
in interface java.util.Collection<A>
addAll
in class java.util.AbstractQueue<A>
public boolean removeAll(java.util.Collection<?> c)
removeAll
in interface java.util.Collection<A>
removeAll
in class java.util.AbstractCollection<A>
public boolean retainAll(java.util.Collection<?> c)
retainAll
in interface java.util.Collection<A>
retainAll
in class java.util.AbstractCollection<A>
public boolean offer(A a)
public A poll()
public A peek()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |