Spine

class Spine(spineReferences: List<SpineReference>)(source)

The spine sections are the sections of the book in the order in which the book should be read.

This contrasts with the Table of Contents sections which is an index into the Book's sections.

See also

Constructors

Link copied to clipboard
constructor(spineReferences: List<SpineReference>)
constructor(tableOfContents: TableOfContents)

Creates a spine out of all the resources in the table of contents.

constructor()

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
Link copied to clipboard
val size: Int

The number of elements in the spine.

Link copied to clipboard

Functions

Link copied to clipboard

Adds the given resource to the spine references and returns it.

Link copied to clipboard

Adds the given spineReference to the spine references and returns it.

Link copied to clipboard
fun findFirstResourceById(resourceId: String?): Int

Finds the first resource that has the given resourceId.

Link copied to clipboard
fun getResource(index: Int): Resource?

Gets the resource at the given index. Null if not found.

Link copied to clipboard
fun getResourceIndex(currentResource: Resource?): Int

The position within the spine of the given resource.

fun getResourceIndex(resourceHref: String?): Int

The first position within the spine of a resource with the given href.

Link copied to clipboard
Link copied to clipboard
fun setSpineReferences(spineReferences: List<SpineReference>)