public class Spine extends Object implements Serializable
TableOfContents
,
Serialized FormConstructor and Description |
---|
Spine() |
Spine(List<SpineReference> spineReferences) |
Spine(TableOfContents tableOfContents)
Creates a spine out of all the resources in the table of contents.
|
Modifier and Type | Method and Description |
---|---|
SpineReference |
addResource(Resource resource)
Adds the given resource to the spine references and returns it.
|
SpineReference |
addSpineReference(SpineReference spineReference)
Adds the given spineReference to the spine references and returns it.
|
static List<SpineReference> |
createSpineReferences(Collection<Resource> resources) |
int |
findFirstResourceById(String resourceId)
Finds the first resource that has the given resourceId.
|
Resource |
getResource(int index)
Gets the resource at the given index.
|
int |
getResourceIndex(Resource currentResource)
The position within the spine of the given resource.
|
int |
getResourceIndex(String resourceHref)
The first position within the spine of a resource with the given href.
|
List<SpineReference> |
getSpineReferences() |
Resource |
getTocResource()
The resource containing the XML for the tableOfContents.
|
boolean |
isEmpty()
Whether the spine has any references
|
void |
setSpineReferences(List<SpineReference> spineReferences) |
void |
setTocResource(Resource tocResource)
As per the epub file format the spine officially maintains a reference to the Table of Contents.
|
int |
size()
The number of elements in the spine.
|
public Spine()
public Spine(TableOfContents tableOfContents)
tableOfContents
- public Spine(List<SpineReference> spineReferences)
public static List<SpineReference> createSpineReferences(Collection<Resource> resources)
public List<SpineReference> getSpineReferences()
public void setSpineReferences(List<SpineReference> spineReferences)
public Resource getResource(int index)
index
- public int findFirstResourceById(String resourceId)
resourceId
- public SpineReference addSpineReference(SpineReference spineReference)
spineReference
- public SpineReference addResource(Resource resource)
public int size()
public void setTocResource(Resource tocResource)
tocResource
- public Resource getTocResource()
public int getResourceIndex(Resource currentResource)
currentResource
- public int getResourceIndex(String resourceHref)
public boolean isEmpty()
Copyright © 2009–2013. All rights reserved.