java.lang.Object
xyz.cofe.coll.im.ImListLinkedBase<A>
- All Implemented Interfaces:
Iterable<A>,Append<ImList<A>,,A> Countable,Emptable<ImList<A>>,Filter<ImList<A>,,A> FMap<A>,FoldLeft<A>,FoldRight<A>,ForEach<A>,ImList<A>,MAP<A>,One<ImList<A>,,A> PositionalRead<A>,Prepend<ImList<A>,,A> Reverse<ImList<A>>,Tail<ImList<A>,A>
- Direct Known Subclasses:
ImListLinked
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface xyz.cofe.coll.im.FMap
FMap.Split<A,B> Nested classes/interfaces inherited from interface xyz.cofe.coll.im.ImList
ImList.Enumerated<A> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionДобавить в конец спискаappend(PositionalRead<? extends A> values) Добавить значения в конецvoidОбход спискаempty()Создает пустую коллекцию<B> ImList<B>fmap(Function<A, PositionalRead<B>> fmapper) Отображение коллекции<B> BfoldLeft(B init, BiFunction<B, A, B> fold) Свертка от начала к концу списка<B> BfoldRight(B init, BiFunction<B, A, B> fold) Свертка списка от конца к началуget(int index) Чтение элемента спискаhead()Чтение "головы" / первого элементаprotected booleanisNil()Проверка, что текущий элемент - это конец спискаiterator()last()Чтение последнего элемента<B> ImList<B>Отображение элементов коллекцииСоздание коллекции с один элементомДобавление элемента в начало спискаprepend(PositionalRead<? extends A> values) Добавление элементов в начало спискаprependUnordered(PositionalRead<A> values) reverse()Разворот спискаprotected abstract <B> ImListLinkedBase<B>selfConstructor(B value, ImListLinkedBase<B> next) Данный метод должен быть переопределен в дочерних классахintsize()Возвращает кол-во элементов<B> FMap.Split<B,A> split(Function<A, FMap.Split<B, A>> mapper) Фильтрация коллекции на две: отфильтрованнуюtail()Возвращение списка без первого элементаtoImList()Возвращает иммутабельный списокMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface xyz.cofe.coll.im.ImList
containsAll, containsAll, containsAll, containsCount, enumerate, find, skip, stream, take, zipMethods inherited from interface java.lang.Iterable
forEach, spliteratorMethods inherited from interface xyz.cofe.coll.im.PositionalRead
toList
-
Constructor Details
-
ImListLinkedBase
-
-
Method Details
-
isNil
protected boolean isNil()Проверка, что текущий элемент - это конец списка- Returns:
- true - конец и не содержит значения
-
selfConstructor
Данный метод должен быть переопределен в дочерних классах- Parameters:
value- значениеnext- ссылка на следующий элемент- Returns:
- список
-
empty
Description copied from interface:EmptableСоздает пустую коллекцию -
one
Description copied from interface:OneСоздание коллекции с один элементом -
prepend
Description copied from interface:PrependДобавление элемента в начало списка -
size
public int size()Description copied from interface:CountableВозвращает кол-во элементов -
each
Description copied from interface:ForEachОбход списка -
get
Description copied from interface:PositionalReadЧтение элемента списка- Specified by:
getin interfacePositionalRead<A>- Parameters:
index- индекс элемента- Returns:
- элемент
-
head
Description copied from interface:PositionalReadЧтение "головы" / первого элемента- Specified by:
headin interfacePositionalRead<A>- Returns:
- элемент
-
last
Description copied from interface:PositionalReadЧтение последнего элемента- Specified by:
lastin interfacePositionalRead<A>- Returns:
- элемент
-
reverse
Description copied from interface:ReverseРазворот списка -
append
Description copied from interface:AppendДобавить в конец списка -
tail
Description copied from interface:TailВозвращение списка без первого элемента -
foldLeft
Description copied from interface:FoldLeftСвертка от начала к концу списка -
foldRight
Description copied from interface:FoldRightСвертка списка от конца к началу -
map
Description copied from interface:MAPОтображение элементов коллекции -
fmap
Description copied from interface:FMapОтображение коллекции -
split
Description copied from interface:FMapФильтрация коллекции на две: отфильтрованную -
append
Description copied from interface:AppendДобавить значения в конец -
prepend
Description copied from interface:PrependДобавление элементов в начало списка -
prependUnordered
-
iterator
-
toImList
Description copied from interface:PositionalReadВозвращает иммутабельный список- Specified by:
toImListin interfacePositionalRead<A>- Returns:
- иммутабельный список
-