Package cz.vutbr.fit.layout.text.chunks
Class DefaultHint
- java.lang.Object
-
- cz.vutbr.fit.layout.text.chunks.DefaultHint
-
- All Implemented Interfaces:
PresentationHint
- Direct Known Subclasses:
HintForceResolved,HintInLine,HintMultiBox,HintSeparator,HintWholeBox
public class DefaultHint extends Object implements PresentationHint
A default no-op presentation hint.- Author:
- burgetr
-
-
Constructor Summary
Constructors Constructor Description DefaultHint(String name, float support)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object obj)SourceBoxListextractBoxes(Area a, SourceBoxList current, Set<Area> processed)Extracts boxes from the given area and/or modifies the already existing list of boxes (preprocessing).StringgetName()floatgetSupport()The probability of the hint based on the analyzed page.inthashCode()booleanimpliesBlock()Does the hint imply that the area has block layout?booleanimpliesInline()Does the hint imply that the area has inline layout?List<TextChunk>postprocessChunks(List<TextChunk> src)Applies the hint to the current list of chunks (postprocessing the whole list)List<TextChunk>processChunks(Area src, List<TextChunk> chunks)Applies the hint to the list of chunks for the given area (postprocessing a list for a given area)List<TagOccurrence>processOccurrences(BoxText boxText, List<TagOccurrence> occurrences)Applies the hint to a list of occurences extracted from the given box text (postprocessing a list of occurences)protected voidsetBlock(boolean block)protected voidsetInline(boolean inline)StringtoString()
-
-
-
Constructor Detail
-
DefaultHint
public DefaultHint(String name, float support)
-
-
Method Detail
-
getName
public String getName()
-
impliesInline
public boolean impliesInline()
Description copied from interface:PresentationHintDoes the hint imply that the area has inline layout?- Specified by:
impliesInlinein interfacePresentationHint- Returns:
-
setInline
protected void setInline(boolean inline)
-
impliesBlock
public boolean impliesBlock()
Description copied from interface:PresentationHintDoes the hint imply that the area has block layout?- Specified by:
impliesBlockin interfacePresentationHint- Returns:
-
setBlock
protected void setBlock(boolean block)
-
getSupport
public float getSupport()
Description copied from interface:PresentationHintThe probability of the hint based on the analyzed page.- Specified by:
getSupportin interfacePresentationHint- Returns:
- the hint support 0.0 .. 1.0
-
extractBoxes
public SourceBoxList extractBoxes(Area a, SourceBoxList current, Set<Area> processed)
Description copied from interface:PresentationHintExtracts boxes from the given area and/or modifies the already existing list of boxes (preprocessing). If some additional areas were processed, they should be added to the 'processed' set.- Specified by:
extractBoxesin interfacePresentationHint- Returns:
-
processOccurrences
public List<TagOccurrence> processOccurrences(BoxText boxText, List<TagOccurrence> occurrences)
Description copied from interface:PresentationHintApplies the hint to a list of occurences extracted from the given box text (postprocessing a list of occurences)- Specified by:
processOccurrencesin interfacePresentationHint- Parameters:
boxText- the source box textoccurrences- the current list of occurrences- Returns:
- the new list of occurrences
-
processChunks
public List<TextChunk> processChunks(Area src, List<TextChunk> chunks)
Description copied from interface:PresentationHintApplies the hint to the list of chunks for the given area (postprocessing a list for a given area)- Specified by:
processChunksin interfacePresentationHint- Returns:
-
postprocessChunks
public List<TextChunk> postprocessChunks(List<TextChunk> src)
Description copied from interface:PresentationHintApplies the hint to the current list of chunks (postprocessing the whole list)- Specified by:
postprocessChunksin interfacePresentationHint- Parameters:
src- the list of chunks (typically for a given tag)- Returns:
-
-