ru.yandex.bolts.collection.ListF Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of bolts Show documentation
Show all versions of bolts Show documentation
Collections utilities used in various Yandex projects
The newest version!
package ru.yandex.bolts.collection;
import java.util.Collection;
import java.util.Iterator;
import java.util.List;
import ru.yandex.bolts.collection.impl.ArrayListF;
import ru.yandex.bolts.function.Function;
import ru.yandex.bolts.function.Function1B;
import ru.yandex.bolts.function.Function2;
public interface ListF extends CollectionF, List {
IteratorF iterator();
IteratorF reverseIterator();
@Override
ListF filter(Function1B super E> p);
@Override
ListF filterNot(Function1B super E> p);
@Override
ListF filterNotNull();
@Override
ListF filterByType(Class type);
/**
* Return pair of lists, first list contains elements matching p
* and second lists contains elements matching !p
.
*
* @param p function
*
* @return tuple
*/
@Override
Tuple2, ListF> partition(Function1B super E> p);
@Override
ListF stableUnique();
ListF subList(int fromIndex, int toIndex);
Tuple2List zipWithIndex();
ListF plus(List extends E> addition);
ListF plus(Collection extends E> elements);
ListF plus(Iterator extends E> iterator);
@SuppressWarnings("unchecked")
ListF plus(E... additions);
ListF plus1(E e);
E first() throws IndexOutOfBoundsException;
E last() throws IndexOutOfBoundsException;
/**
* Return Option.some(first())
or Option.none()
.
*
* @return option first
*/
Option firstO();
/**
* Return Option.some(last())
or Option.none()
.
*
* @return option last
*/
Option lastO();
/** Task first count
elements
*
* @param count count
*
* @return list
* */
ListF take(int count);
ListF drop(int count);
ListF rtake(int count);
ListF rdrop(int count);
ListF takeWhile(Function1B super E> f);
ListF dropWhile(Function1B super E> f);
B foldRight(B z, Function2 super E, ? super B, B> f);
E reduceRight(Function2 f);
Option reduceRightO(Function2 f);
ListF makeReadOnly();
int length();
ListF reverse();
@Override
ListF uncheckedCast();
@Override
ListF cast();
@Override
ListF cast(Class type);
Tuple2List zip(ListF extends B> that);
Tuple2List zipWith(Function super E, ? extends B> f);
@Override
boolean remove(Object o);
boolean removeTs(E e);
boolean removeTu(Object e);
@Override
boolean removeAll(Collection> c);
boolean removeAllTs(Collection extends E> c);
boolean removeAllTu(Collection> c);
@Override
boolean contains(Object o);
boolean containsTs(E e);
boolean containsTu(Object e);
@Override
boolean containsAll(Collection> coll);
boolean containsAllTs(Collection extends E> coll);
boolean containsAllTu(Collection> coll);
@Override
boolean retainAll(Collection> c);
boolean retainAllTs(Collection extends E> c);
boolean retainAllTu(Collection> c);
@Override
int indexOf(Object o);
int indexOfTs(E o);
int indexOfTu(Object o);
} //~