Source set: Common
public class MutableIntervalList<T> : IntervalList<T>
Mutable version of IntervalList. It allows you to add new intervals via addInterval.
Note: this class is a part of LazyLayout harness that allows for building custom lazy layouts. LazyLayout and all corresponding APIs are still under development and are subject to change.
Properties
size
Source set: Common
override var size: Int = 0
Functions
addInterval
Source set: Common
public fun addInterval(size: Int, value: T)
Adds a new interval into this list.
Parameters
| size | the amount of items in the new interval. |
| value | the value representing this interval. |
forEach
Source set: Common
override fun forEach(fromIndex: Int, toIndex: Int, block: (IntervalList.Interval<T>) -> Unit)
Allows to iterate through all the intervals starting from the one containing fromIndex until the one containing toIndex.
Parameters
| fromIndex | we will start iterating from the interval containing this index. |
| toIndex | the last interval we iterate through will contain this index. This index should be not smaller than fromIndex. |
| block | will be invoked on each interval within the defined indexes |
Throws: IndexOutOfBoundsException
if the indexes are not within 0..size - 1 range.
get
Source set: Common
override fun get(index: Int): IntervalList.Interval<T>