public class TableOfContents extends Object implements Serializable
Spine
,
Serialized FormModifier and Type | Field and Description |
---|---|
static String |
DEFAULT_PATH_SEPARATOR |
Constructor and Description |
---|
TableOfContents() |
TableOfContents(List<TOCReference> tocReferences) |
Modifier and Type | Method and Description |
---|---|
TOCReference |
addSection(Resource resource,
int[] pathElements,
String sectionTitlePrefix,
String sectionNumberSeparator)
Adds the given Resources to the TableOfContents at the location specified by the pathElements.
|
TOCReference |
addSection(Resource resource,
String path)
Calls addTOCReferenceAtLocation after splitting the path using the DEFAULT_PATH_SEPARATOR.
|
TOCReference |
addSection(Resource resource,
String[] pathElements)
Adds the given Resources to the TableOfContents at the location specified by the pathElements.
|
TOCReference |
addSection(Resource resource,
String path,
String pathSeparator)
Calls addTOCReferenceAtLocation after splitting the path using the given pathSeparator.
|
TOCReference |
addTOCReference(TOCReference tocReference) |
int |
calculateDepth()
The maximum depth of the reference tree
|
List<Resource> |
getAllUniqueResources()
All unique references (unique by href) in the order in which they are referenced to in the table of contents.
|
List<TOCReference> |
getTocReferences() |
void |
setTocReferences(List<TOCReference> tocReferences) |
int |
size()
The total number of references in this table of contents.
|
public static final String DEFAULT_PATH_SEPARATOR
public TableOfContents()
public TableOfContents(List<TOCReference> tocReferences)
public List<TOCReference> getTocReferences()
public void setTocReferences(List<TOCReference> tocReferences)
public TOCReference addSection(Resource resource, String path)
public TOCReference addSection(Resource resource, String path, String pathSeparator)
resource
- path
- pathSeparator
- public TOCReference addSection(Resource resource, String[] pathElements)
resource
- pathElements
- public TOCReference addSection(Resource resource, int[] pathElements, String sectionTitlePrefix, String sectionNumberSeparator)
resource
- pathElements
- public TOCReference addTOCReference(TOCReference tocReference)
public List<Resource> getAllUniqueResources()
public int size()
public int calculateDepth()
Copyright © 2009–2017. All rights reserved.