Skip to content

//readium-shared/org.readium.r2.shared.util/CursorList

CursorList

[androidJvm]\ class CursorList<E>(list: List<E> = emptyList(), index: Int = -1) : List<E>

A List with a mutable cursor index.

next and previous refer to the last element returned by a previous call to any of both methods.

Parameters

androidJvm

list the content of the CursorList
index the index of the element that will initially be considered as the last returned element. May be -1 or the size of the list as well.

Constructors

CursorList [androidJvm]
fun <E> CursorList(list: List<E> = emptyList(), index: Int = -1)

Functions

Name Summary
contains [androidJvm]
open operator override fun contains(element: E): Boolean
containsAll [androidJvm]
open override fun containsAll(elements: Collection<E>): Boolean
forEach [androidJvm]
open fun forEach(p0: Consumer<in E>)
get [androidJvm]
open operator override fun get(index: Int): E
hasNext [androidJvm]
fun hasNext(): Boolean
hasPrevious [androidJvm]
fun hasPrevious(): Boolean
indexOf [androidJvm]
open override fun indexOf(element: E): Int
isEmpty [androidJvm]
open override fun isEmpty(): Boolean
iterator [androidJvm]
open operator override fun iterator(): Iterator<E>
lastIndexOf [androidJvm]
open override fun lastIndexOf(element: E): Int
listIterator [androidJvm]
open override fun listIterator(): ListIterator<E>
open override fun listIterator(index: Int): ListIterator<E>
next [androidJvm]
fun next(): E?
Moves the cursor forward and returns the element, or null when reaching the end.
parallelStream [androidJvm]
open fun parallelStream(): Stream<E>
previous [androidJvm]
fun previous(): E?
Moves the cursor backward and returns the element, or null when reaching the beginning.
spliterator [androidJvm]
open override fun spliterator(): Spliterator<E>
stream [androidJvm]
open fun stream(): Stream<E>
subList [androidJvm]
open override fun subList(fromIndex: Int, toIndex: Int): List<E>
toArray [androidJvm]
open fun <T : Any> ~~toArray~~(p0: IntFunction<Array<T>>): Array<T>

Properties

Name Summary
size [androidJvm]
open override val size: Int

Extensions

Name Summary
allAreAudio [androidJvm]
val List<Link>.allAreAudio: Boolean
Returns whether all the resources in the collection are audio clips.
allAreBitmap [androidJvm]
val List<Link>.allAreBitmap: Boolean
Returns whether all the resources in the collection are bitmaps.
allAreHtml [androidJvm]
val List<Link>.allAreHtml: Boolean
Returns whether all the resources in the collection are HTML documents.
allAreVideo [androidJvm]
val List<Link>.allAreVideo: Boolean
Returns whether all the resources in the collection are video clips.
allMatchMediaType [androidJvm]
fun List<Link>.allMatchMediaType(mediaType: MediaType): Boolean
Returns whether all the resources in the collection are matching the given media type.
allMatchMediaTypes [androidJvm]
fun List<Link>.allMatchMediaTypes(mediaTypes: List<MediaType>): Boolean
Returns whether all the resources in the collection are matching any of the given media types.
allNamed [androidJvm]
fun List<Href.QueryParameter>.allNamed(name: String): List<String>
filterByMediaType [androidJvm]
fun List<Link>.filterByMediaType(mediaType: MediaType): List<Link>
Finds all the links matching the given media type.
filterByMediaTypes [androidJvm]
fun List<Link>.filterByMediaTypes(mediaTypes: List<MediaType>): List<Link>
Finds all the links matching any of the given media types.
filterByRel [androidJvm]
fun List<Link>.filterByRel(rel: String): List<Link>
Finds all the links with the given relation.
firstNamedOrNull [androidJvm]
fun List<Href.QueryParameter>.firstNamedOrNull(name: String): String?
firstWithHref [androidJvm]
fun List<Link>.firstWithHref(href: String): Link?
Finds the first link matching the given HREF.
firstWithMediaType [androidJvm]
fun List<Link>.firstWithMediaType(mediaType: MediaType): Link?
Finds the first link matching the given media type.
firstWithRel [androidJvm]
fun List<Link>.firstWithRel(rel: String): Link?
Finds the first link with the given relation.
indexOfFirstWithHref [androidJvm]
fun List<Link>.indexOfFirstWithHref(href: String): Int?
Returns the first Link with the given href, or null if not found.
toJSON [androidJvm]
fun List<JSONable>.toJSON(): JSONArray
Serializes a list of JSONable into a JSONArray.
toLinks [androidJvm]
fun List<PdfDocument.OutlineNode>.toLinks(documentHref: String): List<Link>
Converts a PDF outline to Link objects.