Class CrossReferenceHandler
- java.lang.Object
-
- org.daisy.dotify.formatter.impl.search.CrossReferenceHandler
-
public class CrossReferenceHandler extends Object
TODO: Write java doc.
-
-
Constructor Summary
Constructors Constructor Description CrossReferenceHandler()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
commitBreakable()
void
commitPageDetails()
void
commitTransitionProperties()
String
findMarker(PageId id, MarkerReference spec)
Finds a marker value starting from the page with the supplied id.Iterable<AnchorData>
getAnchorData(int volume)
boolean
getBreakable(SheetIdentity ident)
List<String>
getGroupAnchors(BlockAddress blockId)
List<String>
getGroupIdentifiers(BlockAddress blockId)
List<Marker>
getGroupMarkers(BlockAddress blockId)
Optional<BlockLineLocation>
getNextPageLocationInSequence(BlockLineLocation id)
Overhead
getOverhead(int volumeNumber)
Integer
getPageNumber(String refid)
Gets the page number for the specified identifier.int
getPageNumberOfFirstContentPageOfVolume(int volume)
Integer
getPageNumberOffset(String key)
int
getPagesInDocument()
int
getPagesInVolume(int volume)
int
getRowCount(BlockAddress blockId)
int
getSheetsInDocument()
int
getSheetsInVolume(int volume)
Optional<TransitionProperties>
getTransitionProperties(BlockLineLocation id)
int
getVolumeCount()
Gets the number of volumes.VolumeData
getVolumeData(String refid)
Gets the volume data for the specified identifier.boolean
isDirty()
Returns true if some information has been changed since last use.void
keepBreakable(SheetIdentity ident, boolean value)
void
keepPageDetails(PageDetails value)
void
keepTransitionProperties(BlockLineLocation id, TransitionProperties value)
void
resetUniqueChecks()
void
setAnchorData(int volume, Iterable<AnchorData> data)
void
setDirty(boolean value)
Sets the dirty flag on all tracked data.void
setGroupAnchors(BlockAddress blockId, List<String> anchors)
void
setGroupIdentifiers(BlockAddress blockId, List<String> identifiers)
void
setGroupMarkers(BlockAddress blockId, List<Marker> markers)
void
setNextPageDetailsInSequence(BlockLineLocation id, PageDetails details)
void
setNextPageInSequenceEmptyOrAbsent(BlockLineLocation id)
Indicate that a page is the last one in the sequence or that the next page is empty.void
setOverhead(int volumeNumber, Overhead overhead)
void
setPageNumber(String refid, int page)
void
setPageNumberOfFirstContentPageOfVolume(int volume, int value)
void
setPageNumberOffset(String key, Integer value)
void
setReadOnly()
void
setReadWrite()
void
setRowCount(BlockAddress blockId, int value)
void
setSequenceScope(SequenceId sequenceId, int fromIndex, int toIndex)
Sets the sequence scope for the purpose of finding markers in a specific sequence.void
setSheetsInDocument(int value)
void
setSheetsInVolume(int volume, int value)
void
setVolumeCount(int volumes)
void
setVolumeData(String refid, VolumeData volumeData)
void
setVolumeScope(int volumeNumber, int fromIndex, int toIndex)
Sets the volume scope for the purpose of finding markers in a specific volume.void
trimPageDetails()
-
-
-
Method Detail
-
setReadOnly
public void setReadOnly()
-
setReadWrite
public void setReadWrite()
-
getVolumeData
public VolumeData getVolumeData(String refid)
Gets the volume data for the specified identifier.- Parameters:
refid
- the identifier to get the volume for- Returns:
- returns the volume number, one-based
-
setVolumeData
public void setVolumeData(String refid, VolumeData volumeData)
-
getPageNumber
public Integer getPageNumber(String refid)
Gets the page number for the specified identifier.- Parameters:
refid
- the identifier to get the page for- Returns:
- returns the page number, one-based
-
setPageNumber
public void setPageNumber(String refid, int page)
-
getAnchorData
public Iterable<AnchorData> getAnchorData(int volume)
-
setAnchorData
public void setAnchorData(int volume, Iterable<AnchorData> data)
-
setVolumeCount
public void setVolumeCount(int volumes)
-
setSheetsInVolume
public void setSheetsInVolume(int volume, int value)
-
setSheetsInDocument
public void setSheetsInDocument(int value)
-
setPageNumberOfFirstContentPageOfVolume
public void setPageNumberOfFirstContentPageOfVolume(int volume, int value)
-
keepBreakable
public void keepBreakable(SheetIdentity ident, boolean value)
-
commitBreakable
public void commitBreakable()
-
keepTransitionProperties
public void keepTransitionProperties(BlockLineLocation id, TransitionProperties value)
-
commitTransitionProperties
public void commitTransitionProperties()
-
setRowCount
public void setRowCount(BlockAddress blockId, int value)
-
trimPageDetails
public void trimPageDetails()
-
setGroupAnchors
public void setGroupAnchors(BlockAddress blockId, List<String> anchors)
-
setGroupMarkers
public void setGroupMarkers(BlockAddress blockId, List<Marker> markers)
-
setGroupIdentifiers
public void setGroupIdentifiers(BlockAddress blockId, List<String> identifiers)
-
getOverhead
public Overhead getOverhead(int volumeNumber)
-
setOverhead
public void setOverhead(int volumeNumber, Overhead overhead)
-
getVolumeCount
public int getVolumeCount()
Gets the number of volumes.- Returns:
- returns the number of volumes
-
getSheetsInVolume
public int getSheetsInVolume(int volume)
-
getSheetsInDocument
public int getSheetsInDocument()
-
getPagesInVolume
public int getPagesInVolume(int volume)
-
getPageNumberOfFirstContentPageOfVolume
public int getPageNumberOfFirstContentPageOfVolume(int volume)
-
getPagesInDocument
public int getPagesInDocument()
-
getBreakable
public boolean getBreakable(SheetIdentity ident)
-
getTransitionProperties
public Optional<TransitionProperties> getTransitionProperties(BlockLineLocation id)
-
getGroupAnchors
public List<String> getGroupAnchors(BlockAddress blockId)
-
getGroupMarkers
public List<Marker> getGroupMarkers(BlockAddress blockId)
-
getGroupIdentifiers
public List<String> getGroupIdentifiers(BlockAddress blockId)
-
getRowCount
public int getRowCount(BlockAddress blockId)
-
keepPageDetails
public void keepPageDetails(PageDetails value)
-
commitPageDetails
public void commitPageDetails()
-
setSequenceScope
public void setSequenceScope(SequenceId sequenceId, int fromIndex, int toIndex)
Sets the sequence scope for the purpose of finding markers in a specific sequence.- Parameters:
sequenceId
- the sequence idfromIndex
- the start indextoIndex
- the end index
-
setVolumeScope
public void setVolumeScope(int volumeNumber, int fromIndex, int toIndex)
Sets the volume scope for the purpose of finding markers in a specific volume.- Parameters:
volumeNumber
- the volume numberfromIndex
- the start indextoIndex
- the end index
-
findMarker
public String findMarker(PageId id, MarkerReference spec)
Finds a marker value starting from the page with the supplied id.
To find markers, the following methods must be used to register data needed by this method:
- Parameters:
id
- the page id of the page where the search originates. Note that this page is not necessarily the first page searched (depending on the value ofMarkerReference.getOffset()
).spec
- the search specification- Returns:
- returns the marker value, or an empty string if not found
-
getNextPageLocationInSequence
public Optional<BlockLineLocation> getNextPageLocationInSequence(BlockLineLocation id)
-
setNextPageDetailsInSequence
public void setNextPageDetailsInSequence(BlockLineLocation id, PageDetails details)
-
setNextPageInSequenceEmptyOrAbsent
public void setNextPageInSequenceEmptyOrAbsent(BlockLineLocation id)
Indicate that a page is the last one in the sequence or that the next page is empty.- Parameters:
id
- The BlockLineLocation that identifies the page.
-
isDirty
public boolean isDirty()
Returns true if some information has been changed since last use.- Returns:
- true if some information has been changed, false otherwise
-
setDirty
public void setDirty(boolean value)
Sets the dirty flag on all tracked data. This is typically used to reset the value of the flag when rendering another pass. However, by setting this value to true, it can be used to disable tracking for the remainder of the rendering.- Parameters:
value
- the value
-
resetUniqueChecks
public void resetUniqueChecks()
-
-