Package com.appslandia.common.base
Class FluentList<E>
- java.lang.Object
-
- com.appslandia.common.base.FluentList<E>
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Cloneable,java.lang.Iterable<E>,java.util.Collection<E>,java.util.List<E>,java.util.RandomAccess
public class FluentList<E> extends java.lang.Object implements java.util.List<E>, java.util.RandomAccess, java.lang.Cloneable, java.io.Serializable- Author:
- Loc Ha
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description FluentList()FluentList(java.util.List<E> list)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(int index, E element)booleanadd(E e)booleanaddAll(int index, java.util.Collection<? extends E> c)booleanaddAll(java.util.Collection<? extends E> c)voidclear()booleancontains(java.lang.Object o)booleancontainsAll(java.util.Collection<?> c)booleanequals(java.lang.Object o)Efirst()FluentList<E>first(E e)Eget(int index)inthashCode()intindexOf(java.lang.Object o)FluentList<E>ins(int index, E e)FluentList<E>ins(int index, java.util.Collection<? extends E> c)FluentList<E>ins(E e)FluentList<E>ins(java.util.Collection<? extends E> c)booleanisEmpty()java.util.Iterator<E>iterator()Elast()FluentList<E>last(E e)intlastIndexOf(java.lang.Object o)java.util.ListIterator<E>listIterator()java.util.ListIterator<E>listIterator(int index)Eremove(int index)booleanremove(java.lang.Object o)booleanremoveAll(java.util.Collection<?> c)FluentList<E>removeFirst()FluentList<E>removeLast()voidreplaceAll(java.util.function.UnaryOperator<E> operator)booleanretainAll(java.util.Collection<?> c)Eset(int index, E element)intsize()voidsort(java.util.Comparator<? super E> c)java.util.List<E>subList(int fromIndex, int toIndex)java.lang.Object[]toArray()<T> T[]toArray(T[] a)
-
-
-
Field Detail
-
list
protected final java.util.List<E> list
-
-
Constructor Detail
-
FluentList
public FluentList()
-
FluentList
public FluentList(java.util.List<E> list)
-
-
Method Detail
-
first
public FluentList<E> first(E e)
-
last
public FluentList<E> last(E e)
-
ins
public FluentList<E> ins(E e)
-
ins
public FluentList<E> ins(int index, E e)
-
ins
public FluentList<E> ins(int index, java.util.Collection<? extends E> c)
-
ins
public FluentList<E> ins(java.util.Collection<? extends E> c)
-
first
public E first()
- Throws:
java.util.NoSuchElementException- if this list is empty
-
last
public E last()
- Throws:
java.util.NoSuchElementException- if this list is empty
-
removeFirst
public FluentList<E> removeFirst()
- Throws:
java.util.NoSuchElementException- if this list is empty
-
removeLast
public FluentList<E> removeLast()
- Throws:
java.util.NoSuchElementException- if this list is empty
-
add
public boolean add(E e)
-
addAll
public boolean addAll(java.util.Collection<? extends E> c)
-
addAll
public boolean addAll(int index, java.util.Collection<? extends E> c)- Specified by:
addAllin interfacejava.util.List<E>
-
clear
public void clear()
-
contains
public boolean contains(java.lang.Object o)
-
containsAll
public boolean containsAll(java.util.Collection<?> c)
-
equals
public boolean equals(java.lang.Object o)
-
hashCode
public int hashCode()
-
indexOf
public int indexOf(java.lang.Object o)
- Specified by:
indexOfin interfacejava.util.List<E>
-
isEmpty
public boolean isEmpty()
-
iterator
public java.util.Iterator<E> iterator()
-
lastIndexOf
public int lastIndexOf(java.lang.Object o)
- Specified by:
lastIndexOfin interfacejava.util.List<E>
-
listIterator
public java.util.ListIterator<E> listIterator()
- Specified by:
listIteratorin interfacejava.util.List<E>
-
listIterator
public java.util.ListIterator<E> listIterator(int index)
- Specified by:
listIteratorin interfacejava.util.List<E>
-
remove
public boolean remove(java.lang.Object o)
-
removeAll
public boolean removeAll(java.util.Collection<?> c)
-
replaceAll
public void replaceAll(java.util.function.UnaryOperator<E> operator)
- Specified by:
replaceAllin interfacejava.util.List<E>
-
retainAll
public boolean retainAll(java.util.Collection<?> c)
-
size
public int size()
-
sort
public void sort(java.util.Comparator<? super E> c)
- Specified by:
sortin interfacejava.util.List<E>
-
subList
public java.util.List<E> subList(int fromIndex, int toIndex)
- Specified by:
subListin interfacejava.util.List<E>
-
toArray
public java.lang.Object[] toArray()
-
-