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 class
DefaultContext.Builder
TODO: Write java doc.
-
Field Summary
Fields Modifier and Type Field Description protected CrossReferenceHandler
crh
-
Constructor Summary
Constructors Modifier Constructor Description protected
DefaultContext(DefaultContext.Builder builder)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object obj)
static DefaultContext.Builder
from(DefaultContext base)
Integer
getCurrentPage()
Gets the current page number (one based) or null if not known.PageId
getCurrentPageId()
Integer
getCurrentVolume()
Gets the current volume number (one based) or null if not known.Integer
getMetaPage()
Gets the page number (one based) of the context described in the current context, or null if not available.Integer
getMetaVolume()
Gets the volume number (one based) of the context described in the current context, or null if not available.Integer
getPagesInDocument()
Gets the total number of pages contained in the document, or null if not known.Integer
getPagesInVolume()
Gets the total number of pages contained in the current volume, or null if not known.CrossReferenceHandler
getRefs()
Integer
getSheetsInDocument()
Gets the total number of sheets contained in the document, or null if not known.Integer
getSheetsInVolume()
Gets the total number of sheets contained in the current volume, or null if not known.Space
getSpace()
Integer
getVolumeCount()
Gets the volume count or null if not known.int
hashCode()
-
-
-
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:Context
Gets the current volume number (one based) or null if not known.- Specified by:
getCurrentVolume
in interfaceContext
- Returns:
- returns the current volume number
-
getVolumeCount
public Integer getVolumeCount()
Description copied from interface:Context
Gets the volume count or null if not known.- Specified by:
getVolumeCount
in interfaceContext
- Returns:
- returns the volume count
-
getCurrentPage
public Integer getCurrentPage()
Description copied from interface:Context
Gets the current page number (one based) or null if not known.- Specified by:
getCurrentPage
in interfaceContext
- Returns:
- returns the current page number
-
getMetaVolume
public Integer getMetaVolume()
Description copied from interface:Context
Gets 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:
getMetaVolume
in interfaceContext
- Returns:
- returns the meta volume number
-
getMetaPage
public Integer getMetaPage()
Description copied from interface:Context
Gets 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-entry
in 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-resumed
in 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 (
item
in 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-start
andon-page-end
in OBFL), this method can be used to retrieve the number of that page.
- Specified by:
getMetaPage
in 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:Context
Gets 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:
getPagesInVolume
in interfaceContext
- Returns:
- returns the number of pages in the current volume, or null if not known.
-
getPagesInDocument
public Integer getPagesInDocument()
Description copied from interface:Context
Gets the total number of pages contained in the document, or null if not known.- Specified by:
getPagesInDocument
in interfaceContext
- Returns:
- returns the number of pages in the document, or null if not known.
-
getSheetsInVolume
public Integer getSheetsInVolume()
Description copied from interface:Context
Gets 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:
getSheetsInVolume
in interfaceContext
- Returns:
- returns the number of sheets in the current volume, or null if not known.
-
getSheetsInDocument
public Integer getSheetsInDocument()
Description copied from interface:Context
Gets the total number of sheets contained in the document, or null if not known.- Specified by:
getSheetsInDocument
in 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()
-
-