C# Класс nl.siegmann.epublib.domain.TableOfContents

Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
TableOfContents ( ) : System
TableOfContents ( List tocReferences ) : System
addSection ( Resource resource, String pathElements ) : TOCReference

Adds the given Resources to the TableOfContents at the location specified by the pathElements. Example: Calling this method with a Resource and new String[] {"chapter1", "paragraph1"} will result in the following:

  • a TOCReference with the title "chapter1" at the root level.
    If this TOCReference did not yet exist it will have been created and does not point to any resource
  • A TOCReference that has the title "paragraph1". This TOCReference will be the child of TOCReference "chapter1" and will point to the given Resource

addSection ( Resource resource, int pathElements, string sectionTitlePrefix, string sectionNumberSeparator ) : TOCReference

Adds the given Resources to the TableOfContents at the location specified by the pathElements. Example: Calling this method with a Resource and new int[] {0, 0} will result in the following:

  • a TOCReference at the root level.
    If this TOCReference did not yet exist it will have been created with a title of "" and does not point to any resource
  • A TOCReference that points to the given resource and is a child of the previously created TOCReference.
    If this TOCReference didn't exist yet it will be created and have a title of ""

addSection ( Resource resource, string path ) : TOCReference

Calls addTOCReferenceAtLocation after splitting the path using the DEFAULT_PATH_SEPARATOR.

addSection ( Resource resource, string path, string pathSeparator ) : TOCReference

Calls addTOCReferenceAtLocation after splitting the path using the given pathSeparator.

addTOCReference ( TOCReference tocReference ) : TOCReference
calculateDepth ( ) : int
getAllUniqueResources ( ) : List

All unique references (unique by href) in the order in which they are referenced to in the table of contents.

getTocReferences ( ) : List
setTocReferences ( List tocReferences ) : void
size ( ) : int

The total number of references in this table of contents.

Приватные методы

Метод Описание
calculateDepth ( List tocReferences, int currentDepth ) : int
createSectionTitle ( int pathElements, int pathPos, int lastPos, string sectionPrefix, string sectionNumberSeparator ) : string
findTocReferenceByTitle ( string title, List tocReferences ) : TOCReference

Finds the first TOCReference in the given list that has the same title as the given Title.

getAllUniqueResources ( List uniqueHrefs, List result, List tocReferences ) : void
getTotalSize ( List tocReferences ) : int
paddTOCReferences ( List currentTocReferences, int pathElements, int pathPos, string sectionPrefix, string sectionNumberSeparator ) : void

Описание методов

TableOfContents() публичный Метод

public TableOfContents ( ) : System
Результат System

TableOfContents() публичный Метод

public TableOfContents ( List tocReferences ) : System
tocReferences List
Результат System

addSection() публичный Метод

Adds the given Resources to the TableOfContents at the location specified by the pathElements. Example: Calling this method with a Resource and new String[] {"chapter1", "paragraph1"} will result in the following:
  • a TOCReference with the title "chapter1" at the root level.
    If this TOCReference did not yet exist it will have been created and does not point to any resource
  • A TOCReference that has the title "paragraph1". This TOCReference will be the child of TOCReference "chapter1" and will point to the given Resource
public addSection ( Resource resource, String pathElements ) : TOCReference
resource Resource
pathElements String
Результат TOCReference

addSection() публичный Метод

Adds the given Resources to the TableOfContents at the location specified by the pathElements. Example: Calling this method with a Resource and new int[] {0, 0} will result in the following:
  • a TOCReference at the root level.
    If this TOCReference did not yet exist it will have been created with a title of "" and does not point to any resource
  • A TOCReference that points to the given resource and is a child of the previously created TOCReference.
    If this TOCReference didn't exist yet it will be created and have a title of ""
public addSection ( Resource resource, int pathElements, string sectionTitlePrefix, string sectionNumberSeparator ) : TOCReference
resource Resource
pathElements int
sectionTitlePrefix string
sectionNumberSeparator string
Результат TOCReference

addSection() публичный Метод

Calls addTOCReferenceAtLocation after splitting the path using the DEFAULT_PATH_SEPARATOR.
public addSection ( Resource resource, string path ) : TOCReference
resource Resource
path string
Результат TOCReference

addSection() публичный Метод

Calls addTOCReferenceAtLocation after splitting the path using the given pathSeparator.
public addSection ( Resource resource, string path, string pathSeparator ) : TOCReference
resource Resource
path string
pathSeparator string
Результат TOCReference

addTOCReference() публичный Метод

public addTOCReference ( TOCReference tocReference ) : TOCReference
tocReference TOCReference
Результат TOCReference

calculateDepth() публичный Метод

public calculateDepth ( ) : int
Результат int

getAllUniqueResources() публичный Метод

All unique references (unique by href) in the order in which they are referenced to in the table of contents.
public getAllUniqueResources ( ) : List
Результат List

getTocReferences() публичный Метод

public getTocReferences ( ) : List
Результат List

setTocReferences() публичный Метод

public setTocReferences ( List tocReferences ) : void
tocReferences List
Результат void

size() публичный Метод

The total number of references in this table of contents.
public size ( ) : int
Результат int