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 boolean
equals(Object obj)
SourceBoxList
extractBoxes(Area a, SourceBoxList current, Set<Area> processed)
Extracts boxes from the given area and/or modifies the already existing list of boxes (preprocessing).String
getName()
float
getSupport()
The probability of the hint based on the analyzed page.int
hashCode()
boolean
impliesBlock()
Does the hint imply that the area has block layout?boolean
impliesInline()
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 void
setBlock(boolean block)
protected void
setInline(boolean inline)
String
toString()
-
-
-
Constructor Detail
-
DefaultHint
public DefaultHint(String name, float support)
-
-
Method Detail
-
getName
public String getName()
-
impliesInline
public boolean impliesInline()
Description copied from interface:PresentationHint
Does the hint imply that the area has inline layout?- Specified by:
impliesInline
in interfacePresentationHint
- Returns:
-
setInline
protected void setInline(boolean inline)
-
impliesBlock
public boolean impliesBlock()
Description copied from interface:PresentationHint
Does the hint imply that the area has block layout?- Specified by:
impliesBlock
in interfacePresentationHint
- Returns:
-
setBlock
protected void setBlock(boolean block)
-
getSupport
public float getSupport()
Description copied from interface:PresentationHint
The probability of the hint based on the analyzed page.- Specified by:
getSupport
in interfacePresentationHint
- Returns:
- the hint support 0.0 .. 1.0
-
extractBoxes
public SourceBoxList extractBoxes(Area a, SourceBoxList current, Set<Area> processed)
Description copied from interface:PresentationHint
Extracts 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:
extractBoxes
in interfacePresentationHint
- Returns:
-
processOccurrences
public List<TagOccurrence> processOccurrences(BoxText boxText, List<TagOccurrence> occurrences)
Description copied from interface:PresentationHint
Applies the hint to a list of occurences extracted from the given box text (postprocessing a list of occurences)- Specified by:
processOccurrences
in 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:PresentationHint
Applies the hint to the list of chunks for the given area (postprocessing a list for a given area)- Specified by:
processChunks
in interfacePresentationHint
- Returns:
-
postprocessChunks
public List<TextChunk> postprocessChunks(List<TextChunk> src)
Description copied from interface:PresentationHint
Applies the hint to the current list of chunks (postprocessing the whole list)- Specified by:
postprocessChunks
in interfacePresentationHint
- Parameters:
src
- the list of chunks (typically for a given tag)- Returns:
-
-