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 voidcommitBreakable()voidcommitPageDetails()voidcommitTransitionProperties()StringfindMarker(PageId id, MarkerReference spec)Finds a marker value starting from the page with the supplied id.Iterable<AnchorData>getAnchorData(int volume)booleangetBreakable(SheetIdentity ident)List<String>getGroupAnchors(BlockAddress blockId)List<String>getGroupIdentifiers(BlockAddress blockId)List<Marker>getGroupMarkers(BlockAddress blockId)Optional<BlockLineLocation>getNextPageLocationInSequence(BlockLineLocation id)OverheadgetOverhead(int volumeNumber)IntegergetPageNumber(String refid)Gets the page number for the specified identifier.intgetPageNumberOfFirstContentPageOfVolume(int volume)IntegergetPageNumberOffset(String key)intgetPagesInDocument()intgetPagesInVolume(int volume)intgetRowCount(BlockAddress blockId)intgetSheetsInDocument()intgetSheetsInVolume(int volume)Optional<TransitionProperties>getTransitionProperties(BlockLineLocation id)intgetVolumeCount()Gets the number of volumes.VolumeDatagetVolumeData(String refid)Gets the volume data for the specified identifier.booleanisDirty()Returns true if some information has been changed since last use.voidkeepBreakable(SheetIdentity ident, boolean value)voidkeepPageDetails(PageDetails value)voidkeepTransitionProperties(BlockLineLocation id, TransitionProperties value)voidresetUniqueChecks()voidsetAnchorData(int volume, Iterable<AnchorData> data)voidsetDirty(boolean value)Sets the dirty flag on all tracked data.voidsetGroupAnchors(BlockAddress blockId, List<String> anchors)voidsetGroupIdentifiers(BlockAddress blockId, List<String> identifiers)voidsetGroupMarkers(BlockAddress blockId, List<Marker> markers)voidsetNextPageDetailsInSequence(BlockLineLocation id, PageDetails details)voidsetNextPageInSequenceEmptyOrAbsent(BlockLineLocation id)Indicate that a page is the last one in the sequence or that the next page is empty.voidsetOverhead(int volumeNumber, Overhead overhead)voidsetPageNumber(String refid, int page)voidsetPageNumberOfFirstContentPageOfVolume(int volume, int value)voidsetPageNumberOffset(String key, Integer value)voidsetReadOnly()voidsetReadWrite()voidsetRowCount(BlockAddress blockId, int value)voidsetSequenceScope(SequenceId sequenceId, int fromIndex, int toIndex)Sets the sequence scope for the purpose of finding markers in a specific sequence.voidsetSheetsInDocument(int value)voidsetSheetsInVolume(int volume, int value)voidsetVolumeCount(int volumes)voidsetVolumeData(String refid, VolumeData volumeData)voidsetVolumeScope(int volumeNumber, int fromIndex, int toIndex)Sets the volume scope for the purpose of finding markers in a specific volume.voidtrimPageDetails()
-
-
-
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()
-
-