Class DefaultContext
- java.lang.Object
-
- org.daisy.dotify.formatter.impl.search.DefaultContext
-
- All Implemented Interfaces:
Context
- Direct Known Subclasses:
BlockContext
public class DefaultContext extends Object implements Context
TODO: Write java doc.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classDefaultContext.BuilderTODO: Write java doc.
-
Field Summary
Fields Modifier and Type Field Description protected CrossReferenceHandlercrh
-
Constructor Summary
Constructors Modifier Constructor Description protectedDefaultContext(DefaultContext.Builder builder)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object obj)static DefaultContext.Builderfrom(DefaultContext base)IntegergetCurrentPage()Gets the current page number (one based) or null if not known.PageIdgetCurrentPageId()IntegergetCurrentVolume()Gets the current volume number (one based) or null if not known.IntegergetMetaPage()Gets the page number (one based) of the context described in the current context, or null if not available.IntegergetMetaVolume()Gets the volume number (one based) of the context described in the current context, or null if not available.IntegergetPagesInDocument()Gets the total number of pages contained in the document, or null if not known.IntegergetPagesInVolume()Gets the total number of pages contained in the current volume, or null if not known.CrossReferenceHandlergetRefs()IntegergetSheetsInDocument()Gets the total number of sheets contained in the document, or null if not known.IntegergetSheetsInVolume()Gets the total number of sheets contained in the current volume, or null if not known.SpacegetSpace()IntegergetVolumeCount()Gets the volume count or null if not known.inthashCode()
-
-
-
Field Detail
-
crh
protected final CrossReferenceHandler crh
-
-
Constructor Detail
-
DefaultContext
protected DefaultContext(DefaultContext.Builder builder)
-
-
Method Detail
-
from
public static DefaultContext.Builder from(DefaultContext base)
-
getCurrentVolume
public Integer getCurrentVolume()
Description copied from interface:ContextGets the current volume number (one based) or null if not known.- Specified by:
getCurrentVolumein interfaceContext- Returns:
- returns the current volume number
-
getVolumeCount
public Integer getVolumeCount()
Description copied from interface:ContextGets the volume count or null if not known.- Specified by:
getVolumeCountin interfaceContext- Returns:
- returns the volume count
-
getCurrentPage
public Integer getCurrentPage()
Description copied from interface:ContextGets the current page number (one based) or null if not known.- Specified by:
getCurrentPagein interfaceContext- Returns:
- returns the current page number
-
getMetaVolume
public Integer getMetaVolume()
Description copied from interface:ContextGets the volume number (one based) of the context described in the current context, or null if not available.For example, an entry in a table of contents or an end note are examples where this method can be used to retrieve the original context.
- Specified by:
getMetaVolumein interfaceContext- Returns:
- returns the meta volume number
-
getMetaPage
public Integer getMetaPage()
Description copied from interface:ContextGets the page number (one based) of the context described in the current context, or null if not available.For example,
- In the context of an entry in a table of contents,
if it is a standard entry (
toc-entryin OBFL), this method can be used to retrieve the page number of the block the entry is connected with. If it is a resumed entry (toc-entry-on-resumedin OBFL), this method would be used to retrieve the number of the first content page after the volume break that corresponds with this entry. - In the context of an end note (
itemin OBFL) this method can be used to retrieve the page number of the anchor that the item is connected with. - In the context of a group of end notes that are referenced from the
same page (
on-page-startandon-page-endin OBFL), this method can be used to retrieve the number of that page.
- Specified by:
getMetaPagein interfaceContext- Returns:
- returns the meta page number
- In the context of an entry in a table of contents,
if it is a standard entry (
-
getPagesInVolume
public Integer getPagesInVolume()
Description copied from interface:ContextGets the total number of pages contained in the current volume, or null if not known. This should include the volume's pre- and post-content.- Specified by:
getPagesInVolumein interfaceContext- Returns:
- returns the number of pages in the current volume, or null if not known.
-
getPagesInDocument
public Integer getPagesInDocument()
Description copied from interface:ContextGets the total number of pages contained in the document, or null if not known.- Specified by:
getPagesInDocumentin interfaceContext- Returns:
- returns the number of pages in the document, or null if not known.
-
getSheetsInVolume
public Integer getSheetsInVolume()
Description copied from interface:ContextGets the total number of sheets contained in the current volume, or null if not known. This should include the volume's pre- and post-content.- Specified by:
getSheetsInVolumein interfaceContext- Returns:
- returns the number of sheets in the current volume, or null if not known.
-
getSheetsInDocument
public Integer getSheetsInDocument()
Description copied from interface:ContextGets the total number of sheets contained in the document, or null if not known.- Specified by:
getSheetsInDocumentin interfaceContext- Returns:
- returns the number of sheets in the document, or null if not known.
-
getRefs
public CrossReferenceHandler getRefs()
-
getSpace
public Space getSpace()
-
getCurrentPageId
public PageId getCurrentPageId()
-
-