Top Fields Constructors Methods
org.reactfx.util

pack-priv Class ListConcatenation<E>

Located in compilation unit of org.reactfx.util.Lists.

extends AbstractList<E>
Class Inheritance

Field Summary

Modifier and TypeField and Description
private final FingerTree<List<E>, Integer>
private static final ToSemigroup<List<?>, Integer>
Inherited from java.util.AbstractList:
modCount

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
pack-priv static <E> List<E>
create(List<List<? extends E>> lists)

private ListConcatenation<E>
drop(int n)

public E
get(int index)

Implements abstract java.util.AbstractList.get.

Implements java.util.List.get.

Returns the element at the specified position in this list.

public int
size()

Implements abstract java.util.AbstractCollection.size.

Implements java.util.List.size, java.util.Collection.size.

Returns the number of elements in this list.

public List<E>
subList(int from, int to)

Overrides java.util.AbstractList.subList.

Implements java.util.List.subList.

Returns a view of the portion of this list between the specified fromIndex, inclusive, and toIndex, exclusive.

private ListConcatenation<E>
trim(int limit)

Inherited from java.util.AbstractList:
addaddaddAllclearequalshashCodeindexOfiteratorlastIndexOflistIteratorlistIteratorremoveremoveRangeset

Field Detail

ftback to summary
private final FingerTree<List<E>, Integer> ft
LIST_SIZE_MONOIDback to summary
private static final ToSemigroup<List<?>, Integer> LIST_SIZE_MONOID

Constructor Detail

ListConcatenationback to summary
pack-priv ListConcatenation(FingerTree<List<E>, Integer> ft)

Method Detail

createback to summary
pack-priv static <E> List<E> create(List<List<? extends E>> lists)
dropback to summary
private ListConcatenation<E> drop(int n)
getback to summary
public E get(int index)

Implements abstract java.util.AbstractList.get.

Implements java.util.List.get.

Doc from java.util.AbstractList.get.

Returns the element at the specified position in this list.

Annotations
@Override
sizeback to summary
public int size()

Implements abstract java.util.AbstractCollection.size.

Implements java.util.List.size, java.util.Collection.size.

Doc from java.util.List.size.

Returns the number of elements in this list. If this list contains more than Integer.MAX_VALUE elements, returns Integer.MAX_VALUE.

Annotations
@Override
subListback to summary
public List<E> subList(int from, int to)

Overrides java.util.AbstractList.subList.

Implements java.util.List.subList.

Doc from java.util.AbstractList.subList.

Returns a view of the portion of this list between the specified fromIndex, inclusive, and toIndex, exclusive. (If fromIndex and toIndex are equal, the returned list is empty.) The returned list is backed by this list, so non-structural changes in the returned list are reflected in this list, and vice-versa. The returned list supports all of the optional list operations supported by this list.

This method eliminates the need for explicit range operations (of the sort that commonly exist for arrays). Any operation that expects a list can be used as a range operation by passing a subList view instead of a whole list. For example, the following idiom removes a range of elements from a list:

list.subList(from, to).clear();
Similar idioms may be constructed for indexOf and lastIndexOf, and all of the algorithms in the Collections class can be applied to a subList.

The semantics of the list returned by this method become undefined if the backing list (i.e., this list) is structurally modified in any way other than via the returned list. (Structural modifications are those that change the size of this list, or otherwise perturb it in such a fashion that iterations in progress may yield incorrect results.)

Annotations
@Override
trimback to summary
private ListConcatenation<E> trim(int limit)