public class ListBuffer<A> extends AbstractQueue<A>
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.
Constructor and Description |
---|
ListBuffer()
Create a new initially empty list buffer.
|
Modifier and Type | Method and Description |
---|---|
boolean |
add(A a) |
boolean |
addAll(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(Object x)
Does the list contain the specified element?
|
boolean |
containsAll(Collection<?> c) |
A |
first()
The first element in this buffer.
|
boolean |
isEmpty()
Is buffer empty?
|
Iterator<A> |
iterator()
An enumeration of all elements in this buffer.
|
A |
last() |
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 <T> ListBuffer<T> |
of(T x) |
boolean |
offer(A a) |
A |
peek() |
A |
poll() |
ListBuffer<A> |
prepend(A x)
Prepend an element to buffer.
|
boolean |
remove(Object o) |
boolean |
removeAll(Collection<?> c) |
boolean |
retainAll(Collection<?> c) |
int |
size() |
Object[] |
toArray() |
<T> T[] |
toArray(T[] vec)
Convert buffer to an array
|
List<A> |
toList()
Convert buffer to a list of all its elements.
|
element, remove
toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
equals, hashCode, parallelStream, removeIf, spliterator, stream
public static <T> ListBuffer<T> of(T x)
public final void clear()
clear
in interface Collection<A>
clear
in class AbstractQueue<A>
public int length()
public int size()
size
in interface Collection<A>
size
in class AbstractCollection<A>
public boolean isEmpty()
isEmpty
in interface Collection<A>
isEmpty
in class AbstractCollection<A>
public boolean nonEmpty()
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 boolean contains(Object x)
contains
in interface Collection<A>
contains
in class AbstractCollection<A>
public <T> T[] toArray(T[] vec)
toArray
in interface Collection<A>
toArray
in class AbstractCollection<A>
public Object[] toArray()
toArray
in interface Collection<A>
toArray
in class AbstractCollection<A>
public A first()
public A next()
public Iterator<A> iterator()
iterator
in interface Iterable<A>
iterator
in interface Collection<A>
iterator
in class AbstractCollection<A>
public boolean add(A a)
add
in interface Collection<A>
add
in interface Queue<A>
add
in class AbstractQueue<A>
public boolean remove(Object o)
remove
in interface Collection<A>
remove
in class AbstractCollection<A>
public boolean containsAll(Collection<?> c)
containsAll
in interface Collection<A>
containsAll
in class AbstractCollection<A>
public boolean addAll(Collection<? extends A> c)
addAll
in interface Collection<A>
addAll
in class AbstractQueue<A>
public boolean removeAll(Collection<?> c)
removeAll
in interface Collection<A>
removeAll
in class AbstractCollection<A>
public boolean retainAll(Collection<?> c)
retainAll
in interface Collection<A>
retainAll
in class AbstractCollection<A>
public boolean offer(A a)
public A poll()
public A peek()
public A last()
Copyright © 2015. All rights reserved.