Package com.complexible.common.collect
Interface BufferList<T>
- All Superinterfaces:
Collection<T>,Iterable<T>
- All Known Subinterfaces:
ExtendedBufferList<T>
- Since:
- 3.0
- Version:
- 3.0
- Author:
- Evren Sirin
-
Method Summary
Modifier and TypeMethodDescriptionbooleanAdds an element to this buffer list.default booleanaddAll(BufferList<T> buffer) booleanaddAll(BufferList<T> buffer, int fromIndex, int length) Adds the contents of another buffer list to this one.<E extends T>
E[]array()Returns the array which stores the contents of this buffer list.intcapacity()voidclear()getAt(int index) booleanisEmpty()booleanisFull()com.google.common.collect.PeekingIterator<T> iterator()intsize()Returns the actual number of elements in the buffer list.sort(Comparator<? super T> theComparator) voidtruncate(int size) Methods inherited from interface java.util.Collection
addAll, contains, containsAll, equals, hashCode, parallelStream, remove, removeAll, removeIf, retainAll, spliterator, stream, toArray, toArray, toArray
-
Method Details
-
add
Adds an element to this buffer list.- Specified by:
addin interfaceCollection<T>- Parameters:
stmt-- Returns:
- true if the buffer list reached its maximum capacity
-
addAll
Adds the contents of another buffer list to this one.- Parameters:
buffer- the other buffer listfromIndex- the index in the other buffer list to start adding from (inclusive)length- the number of elements to add- Returns:
- true if the buffer list reached its maximum capacity
-
addAll
-
isEmpty
boolean isEmpty()- Specified by:
isEmptyin interfaceCollection<T>
-
isFull
boolean isFull() -
iterator
-
clear
void clear()- Specified by:
clearin interfaceCollection<T>
-
truncate
void truncate(int size) -
array
Returns the array which stores the contents of this buffer list. Length of the array can be greater than the number of stored elements.- Returns:
-
size
int size()Returns the actual number of elements in the buffer list.- Specified by:
sizein interfaceCollection<T>- Returns:
-
capacity
int capacity() -
sort
-
getAt
-