public class HighlightOptions extends Object
An instance of HighlightOptions class is used as parameter in Parser.getHighlight(int, boolean, HighlightOptions) method.
See the usage examples there.
Learn more:
| Constructor and Description |
|---|
HighlightOptions()
Initializes a new instance of the
HighlightOptions class with no limits set. |
HighlightOptions(int maxLength)
Initializes a new instance of the
HighlightOptions class which is used to extract a fixed-length highlight. |
HighlightOptions(Integer maxLength,
boolean isLineLimited)
Initializes a new instance of the
HighlightOptions class which is used to extract a line-limited highlight. |
HighlightOptions(Integer maxLength,
int wordCount)
Initializes a new instance of the
HighlightOptions class which is used to extract a highlight with the fixed word count. |
HighlightOptions(Integer maxLength,
Integer wordCount,
boolean isLineLimited)
Initializes a new instance of the
HighlightOptions class. |
| Modifier and Type | Method and Description |
|---|---|
Integer |
getMaxLength()
Gets a maximum text length.
|
Integer |
getWordCount()
Gets a maximum word count.
|
boolean |
isLineLimited()
Gets value that indicates whether highlight extraction is limited by the start (or the end) of a text line.
|
void |
setLineLimited(boolean lineLimited)
Sets the value that indicates whether highlight extraction is limited by the start (or the end) of a text line.
|
void |
setMaxLength(Integer maxLength)
Sets a maximum text length.
|
void |
setWordCount(Integer wordCount)
Sets a maximum word count.
|
public HighlightOptions()
HighlightOptions class with no limits set.
Set at least one of setMaxLength(Integer), setWordCount(Integer),
setLineLimited(boolean) before passing to the parser.public HighlightOptions(int maxLength)
HighlightOptions class which is used to extract a fixed-length highlight.maxLength - The maximum text length.public HighlightOptions(Integer maxLength, boolean isLineLimited)
HighlightOptions class which is used to extract a line-limited highlight.maxLength - The maximum text length.isLineLimited - The value that indicates whether the highlight extraction is limited by the start (or the end) of a text line.public HighlightOptions(Integer maxLength, int wordCount)
HighlightOptions class which is used to extract a highlight with the fixed word count.maxLength - The maximum text length.wordCount - The maximum word count.public HighlightOptions(Integer maxLength, Integer wordCount, boolean isLineLimited)
HighlightOptions class.maxLength - The maximum text length.wordCount - The maximum word count.isLineLimited - The value that indicates whether the highlight extraction is limited by the start (or the end) of a text line.public Integer getMaxLength()
null if the text length isn't limited.public Integer getWordCount()
null if the word count isn't limited.public boolean isLineLimited()
true if highlight extraction is limited by the start (or the end) of a text line; otherwise, false.public void setMaxLength(Integer maxLength)
maxLength - A non-negative integer; null to remove the length limit.public void setWordCount(Integer wordCount)
wordCount - A non-negative integer; null to remove the word-count limit.public void setLineLimited(boolean lineLimited)
lineLimited - true to limit by line bounds.Copyright © 2026. All rights reserved.