This is NOT part of any supported API. 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.
| Modifier and Type | Field and Description |
|---|---|
| private int | count
The number of element in this buffer. |
| private List | elems
The list of elements of this buffer. |
| private List | last
A pointer pointing to the last element of 'elems' containing data, or null if the list is empty. |
| private boolean | shared
Has a list been created from this buffer yet? |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | add(A a)
Overrides java. Implements java. Inserts the specified element into this queue if it is possible to do so
immediately without violating capacity restrictions, returning
|
| public boolean | addAll(Collection<? extends A> c)
Overrides java. Implements java. Adds all of the elements in the specified collection to this queue. |
| public ListBuffer | |
| public ListBuffer | |
| public ListBuffer | |
| public ListBuffer | |
| public final void | clear()
Overrides java. Implements java. Removes all of the elements from this queue. |
| public boolean | contains(Object x)
Overrides java. Implements java. Does the list contain the specified element? |
| public boolean | containsAll(Collection<?> c)
Overrides java. Implements java. Returns |
| private void | |
| public A | |
| public boolean | isEmpty()
Overrides java. Implements java. Is buffer empty? |
| public Iterator | iterator()
Implements abstract java. Implements java. An enumeration of all elements in this buffer. |
| public A | |
| public int | |
| public A | |
| public boolean | |
| public static <T> ListBuffer | |
| public boolean | offer(A a)
Implements java. Inserts the specified element into this queue if it is possible to do so immediately without violating capacity restrictions. |
| public A | peek()
Implements java. Retrieves, but does not remove, the head of this queue,
or returns |
| public A | poll()
Implements java. Retrieves and removes the head of this queue,
or returns |
| public ListBuffer | |
| public boolean | remove(Object o)
Overrides java. Implements java. Removes a single instance of the specified element from this collection, if it is present (optional operation). |
| public boolean | removeAll(Collection<?> c)
Overrides java. Implements java. Removes all of this collection's elements that are also contained in the specified collection (optional operation). |
| public boolean | retainAll(Collection<?> c)
Overrides java. Implements java. Retains only the elements in this collection that are contained in the specified collection (optional operation). |
| public int | size()
Implements abstract java. Implements java. Returns the number of elements in this collection. |
| public <T> T[] | toArray(T[] vec)
Overrides java. Implements java. Convert buffer to an array |
| public Object[] | toArray()
Overrides java. Implements java. Returns an array containing all of the elements in this collection. |
| public List |
| count | back to summary |
|---|---|
| private int count The number of element in this buffer. | |
| elems | back to summary |
|---|---|
| private List<A> elems The list of elements of this buffer. | |
| last | back to summary |
|---|---|
| private List<A> last A pointer pointing to the last element of 'elems' containing data, or null if the list is empty. | |
| shared | back to summary |
|---|---|
| private boolean shared Has a list been created from this buffer yet? | |
| ListBuffer | back to summary |
|---|---|
| public ListBuffer() Create a new initially empty list buffer. | |
| add | back to summary |
|---|---|
| public boolean add(A a) Overrides java. Implements java. Doc from java. Inserts the specified element into this queue if it is possible to do so
immediately without violating capacity restrictions, returning
This implementation returns | |
| addAll | back to summary |
|---|---|
| public boolean addAll(Collection<? extends A> c) Overrides java. Implements java. Doc from java. Adds all of the elements in the specified collection to this
queue. Attempts to addAll of a queue to itself result in
This implementation iterates over the specified collection,
and adds each element returned by the iterator to this
queue, in turn. A runtime exception encountered while
trying to add an element (including, in particular, a
| |
| append | back to summary |
|---|---|
| public ListBuffer Append an element to buffer. | |
| appendArray | back to summary |
|---|---|
| public ListBuffer Append all elements in an array to buffer. | |
| appendList | back to summary |
|---|---|
| public ListBuffer Append all elements in a list to buffer. | |
| appendList | back to summary |
|---|---|
| public ListBuffer Append all elements in a list to buffer. | |
| clear | back to summary |
|---|---|
| public final void clear() Overrides java. Implements java. Doc from java. Removes all of the elements from this queue. The queue will be empty after this call returns. This implementation repeatedly invokes | |
| contains | back to summary |
|---|---|
| public boolean contains(Object x) Overrides java. Implements java. Does the list contain the specified element? | |
| containsAll | back to summary |
|---|---|
| public boolean containsAll(Collection<?> c) Overrides java. Implements java. Doc from java. Returns | |
| copy | back to summary |
|---|---|
| private void copy() Copy list and sets last. | |
| first | back to summary |
|---|---|
| public A first() The first element in this buffer. | |
| isEmpty | back to summary |
|---|---|
| public boolean isEmpty() Overrides java. Implements java. Is buffer empty? | |
| iterator | back to summary |
|---|---|
| public Iterator Implements abstract java. Implements java. An enumeration of all elements in this buffer. | |
| last | back to summary |
|---|---|
| public A last() | |
| length | back to summary |
|---|---|
| public int length() Return the number of elements in this buffer. | |
| next | back to summary |
|---|---|
| public A next() Return first element in this buffer and remove | |
| nonEmpty | back to summary |
|---|---|
| public boolean nonEmpty() Is buffer not empty? | |
| of | back to summary |
|---|---|
| public static <T> ListBuffer | |
| offer | back to summary |
|---|---|
| public boolean offer(A a) Implements java. Doc from java. Inserts the specified element into this queue if it is possible to do
so immediately without violating capacity restrictions.
When using a capacity-restricted queue, this method is generally
preferable to | |
| peek | back to summary |
|---|---|
| public A peek() Implements java. Doc from java. Retrieves, but does not remove, the head of this queue,
or returns | |
| poll | back to summary |
|---|---|
| public A poll() Implements java. Doc from java. Retrieves and removes the head of this queue,
or returns | |
| prepend | back to summary |
|---|---|
| public ListBuffer Prepend an element to buffer. | |
| remove | back to summary |
|---|---|
| public boolean remove(Object o) Overrides java. Implements java. Doc from java. Removes a single instance of the specified element from this
collection, if it is present (optional operation). More formally,
removes an element | |
| removeAll | back to summary |
|---|---|
| public boolean removeAll(Collection<?> c) Overrides java. Implements java. Doc from java. Removes all of this collection's elements that are also contained in the specified collection (optional operation). After this call returns, this collection will contain no elements in common with the specified collection. | |
| retainAll | back to summary |
|---|---|
| public boolean retainAll(Collection<?> c) Overrides java. Implements java. Doc from java. Retains only the elements in this collection that are contained in the specified collection (optional operation). In other words, removes from this collection all of its elements that are not contained in the specified collection. | |
| size | back to summary |
|---|---|
| public int size() Implements abstract java. Implements java. Doc from java. Returns the number of elements in this collection. If this collection
contains more than | |
| toArray | back to summary |
|---|---|
| public <T> T[] toArray(T[] vec) Overrides java. Implements java. Convert buffer to an array | |
| toArray | back to summary |
|---|---|
| public Object[] toArray() Overrides java. Implements java. Doc from java. Returns an array containing all of the elements in this collection.
If this collection makes any guarantees as to what order its elements
are returned by its iterator, this method must return the elements in
the same order. The returned array's runtime component type is The returned array will be "safe" in that no references to it are maintained by this collection. (In other words, this method must allocate a new array even if this collection is backed by an array). The caller is thus free to modify the returned array. | |
| toList | back to summary |
|---|---|
| public List Convert buffer to a list of all its elements. | |