Package cn.cloudself.query.util.iterator
Class ListEx<T>
- java.lang.Object
-
- cn.cloudself.query.util.iterator.ListEx<T>
-
- All Implemented Interfaces:
Iterable<T>,Collection<T>,List<T>
public class ListEx<T> extends Object implements List<T>
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(int index, T element)booleanadd(T t)booleanaddAll(int index, Collection<? extends T> c)booleanaddAll(Collection<? extends T> c)voidclear()booleancontains(Object o)booleancontainsAll(Collection<?> c)Optional<T>findAnyOpt()TfindAnyOrNull()voidforEach(Consumer<? super T> action)Tget(int index)intindexOf(Object o)booleanisEmpty()Iterator<T>iterator()intlastIndexOf(Object o)ListIterator<T>listIterator()ListIterator<T>listIterator(int index)static <T> List<T>of(T obj)Stream<T>parallelStream()Tremove(int index)booleanremove(Object o)booleanremoveAll(Collection<?> c)booleanremoveIf(Predicate<? super T> filter)voidreplaceAll(UnaryOperator<T> operator)booleanretainAll(Collection<?> c)Tset(int index, T element)intsize()voidsort(Comparator<? super T> c)Spliterator<T>spliterator()Stream<T>stream()List<T>subList(int fromIndex, int toIndex)Object[]toArray()<T1> T1[]toArray(T1[] a)Set<T>toSet()StringtoString()-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.Collection
toArray
-
-
-
-
Method Detail
-
of
public static <T> List<T> of(T obj)
-
findAnyOrNull
@Nullable public T findAnyOrNull()
-
size
public int size()
-
isEmpty
public boolean isEmpty()
-
contains
public boolean contains(Object o)
-
toArray
@NotNull public Object[] toArray()
-
toArray
@NotNull public <T1> T1[] toArray(@NotNull T1[] a)
-
add
public boolean add(T t)
-
remove
public boolean remove(Object o)
-
containsAll
public boolean containsAll(@NotNull Collection<?> c)- Specified by:
containsAllin interfaceCollection<T>- Specified by:
containsAllin interfaceList<T>
-
addAll
public boolean addAll(@NotNull Collection<? extends T> c)
-
addAll
public boolean addAll(int index, @NotNull Collection<? extends T> c)
-
removeAll
public boolean removeAll(@NotNull Collection<?> c)
-
removeIf
public boolean removeIf(Predicate<? super T> filter)
- Specified by:
removeIfin interfaceCollection<T>
-
retainAll
public boolean retainAll(@NotNull Collection<?> c)
-
replaceAll
public void replaceAll(UnaryOperator<T> operator)
- Specified by:
replaceAllin interfaceList<T>
-
sort
public void sort(Comparator<? super T> c)
-
clear
public void clear()
-
lastIndexOf
public int lastIndexOf(Object o)
- Specified by:
lastIndexOfin interfaceList<T>
-
listIterator
@NotNull public ListIterator<T> listIterator()
- Specified by:
listIteratorin interfaceList<T>
-
listIterator
@NotNull public ListIterator<T> listIterator(int index)
- Specified by:
listIteratorin interfaceList<T>
-
spliterator
public Spliterator<T> spliterator()
- Specified by:
spliteratorin interfaceCollection<T>- Specified by:
spliteratorin interfaceIterable<T>- Specified by:
spliteratorin interfaceList<T>
-
stream
public Stream<T> stream()
- Specified by:
streamin interfaceCollection<T>
-
parallelStream
public Stream<T> parallelStream()
- Specified by:
parallelStreamin interfaceCollection<T>
-
-