| java.lang.Object | ||
| ↳ | com.davidluoye.support.util.queue.FixQueue<T> | |
| ↳ | com.davidluoye.support.util.queue.SynchronizedFixQueue<T> | |
| Public Constructors | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| SynchronizedFixQueue() | |||||||||||
| SynchronizedFixQueue(int maxCapacity) | |||||||||||
| SynchronizedFixQueue(T[] array) | |||||||||||
| SynchronizedFixQueue(T[] array, int maxCapacity) | |||||||||||
| SynchronizedFixQueue(int initCapacity, int maxCapacity) | |||||||||||
| Public Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| boolean |
add(Collection<T> cc)
Inserts the specified elements into tail of this queue.
| ||||||||||
| boolean |
add(T t)
Inserts the specified element into tail of this queue.
| ||||||||||
| boolean | add(T[] cc) | ||||||||||
| void | forEach(Consumer<? super T> action) | ||||||||||
| void | forEach(BiConsumer<Integer, ? super T> action) | ||||||||||
| T |
get(int index)
Retrieves, but does not remove, the special index element of this queue.
| ||||||||||
| List<T> | getQueue() | ||||||||||
| int |
indexOf(T t)
Returns the index of the first occurrence of the specified element
in this list, or -1 if this list does not contain the element.
| ||||||||||
| boolean | isEmpty() | ||||||||||
| boolean | isNotEmpty() | ||||||||||
| static <T> SynchronizedFixQueue<T> | of(T... ts) | ||||||||||
| static <T> SynchronizedFixQueue<T> | of(int maxCapacity, T... ts) | ||||||||||
| T |
peek()
Retrieves, but does not remove, the head of this queue,
or returns
null if this queue is empty. | ||||||||||
| T |
poll()
Retrieves and removes the head of this queue,
or returns
null if this queue is empty. | ||||||||||
| T |
pop()
Retrieves and removes the tail of this queue,
or returns
null if this queue is empty. | ||||||||||
| T |
remove(int index)
Remove the special index element from this queue.
| ||||||||||
| void |
remove()
Remove all the elements from this queue.
| ||||||||||
| int |
size()
Returns the number of elements in this queue.
| ||||||||||
| Stream<T> | stream(int startInclusive, int endExclusive) | ||||||||||
| Stream<T> | stream() | ||||||||||
| T |
tail()
Retrieves, but does not remove, the tail of this queue,
or returns
null if this queue is empty. | ||||||||||
| <T1> T1[] |
toArray(T1[] a)
Returns an array containing all of the elements in this queue
in proper sequence (from first to last element).
| ||||||||||
| Object[] |
toArray()
Returns an array containing all of the elements in this queue
in proper sequence (from first to last element).
| ||||||||||
| <A> A[] |
toArray(IntFunction<A[]> generator)
Returns an array containing the elements of this stream, using the
provided
generator function to allocate the returned array, as
well as any additional arrays that might be required for a partitioned
execution or for resizing. | ||||||||||
| Protected Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| FixQueue<T> | onCloneNewQueue(int maxCapacity) | ||||||||||
|
[Expand]
Inherited Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
From class
com.davidluoye.support.util.queue.FixQueue
| |||||||||||
From class
java.lang.Object
| |||||||||||
From interface
com.davidluoye.support.util.queue.IQueue
| |||||||||||
From interface
java.lang.Iterable
| |||||||||||
Inserts the specified elements into tail of this queue.
| cc | the element to add |
|---|
true (as specified by add(E))
Inserts the specified element into tail of this queue.
| t | the element to add |
|---|
true (as specified by add(E))
Retrieves, but does not remove, the special index element of this queue.
Returns the index of the first occurrence of the specified element in this list, or -1 if this list does not contain the element. More formally, returns the lowest index i such that (o==null ? get(i)==null : o.equals(get(i))), or -1 if there is no such index.
Retrieves, but does not remove, the head of this queue,
or returns null if this queue is empty.
null if this queue is empty
Retrieves and removes the head of this queue,
or returns null if this queue is empty.
null if this queue is empty
Retrieves and removes the tail of this queue,
or returns null if this queue is empty.
null if this queue is empty
Remove the special index element from this queue.
Remove all the elements from this queue.
Returns the number of elements in this queue.
Retrieves, but does not remove, the tail of this queue,
or returns null if this queue is empty.
null if this queue is empty
Returns an array containing all of the elements in this queue in proper sequence (from first to last element).
The returned array will be "safe" in that no references to it are maintained by this list. (In other words, this method must allocate a new array). The caller is thus free to modify the returned array.
This method acts as bridge between array-based and collection-based APIs.
Returns an array containing all of the elements in this queue in proper sequence (from first to last element).
The returned array will be "safe" in that no references to it are maintained by this list. (In other words, this method must allocate a new array). The caller is thus free to modify the returned array.
This method acts as bridge between array-based and collection-based APIs.
Returns an array containing the elements of this stream, using the
provided generator function to allocate the returned array, as
well as any additional arrays that might be required for a partitioned
execution or for resizing.
This is a terminal operation. The generator function takes an integer, which is the size of the desired array, and produces an array of the desired size. This can be concisely expressed with an array constructor reference:
Person[] men = people.stream()
.filter(p -> p.getGender() == MALE)
.toArray(Person[]::new);
| generator | a function which produces a new array of the desired type and the provided length |
|---|