Class ContextArgs
java.lang.Object
org.opengrok.indexer.search.context.ContextArgs
Represents an immutable settings instance for coordinating objects related
to producing context presentations.
-
Constructor Summary
ConstructorsConstructorDescriptionContextArgs(short contextSurround, short contextLimit) Initializes an instance with the specified values. -
Method Summary
Modifier and TypeMethodDescriptionshortGets the maximum number of lines to present, after which a "more..." link is displayed to allow the user to view full match results.shortGets the number of lines of leading and trailing context surrounding each match line to present.intGets a value indicating the maximum width to show for lines in a context presentation.
-
Constructor Details
-
ContextArgs
public ContextArgs(short contextSurround, short contextLimit) Initializes an instance with the specified values.shortis used because some Lucene classes were found to choke when OpenGrok usedInteger.MAX_VALUEto mean "unbounded".shortis safer therefore but unfortunately somewhat syntactically inconvenient.- Parameters:
contextSurround- a non-negative valuecontextLimit- a positive value
-
-
Method Details
-
getContextSurround
public short getContextSurround()Gets the number of lines of leading and trailing context surrounding each match line to present.(N.b. the value is used w.r.t.
getContextLimit()and therefore w.r.t. Luceneuhighlight, andshortis safer, though syntactically inconvenient, to avoid numeric overlow that may occur withintin that library.)- Returns:
- a non-negative value
-
getContextLimit
public short getContextLimit()Gets the maximum number of lines to present, after which a "more..." link is displayed to allow the user to view full match results.(N.b. the value is used with Lucene
uhighlight, andshortis safer, though syntactically inconvenient, to avoid numeric overflow that may occur withintin that library.)- Returns:
- a positive value
-
getContextWidth
public int getContextWidth()Gets a value indicating the maximum width to show for lines in a context presentation.- Returns:
- a positive value
-