Package org.plumelib.util
Class EntryReader.Entry
java.lang.Object
org.plumelib.util.EntryReader.Entry
- Enclosing class:
- EntryReader
Descriptor for an entry (record, paragraph, etc.).
-
Field Summary
Modifier and TypeFieldDescriptionfinal String
Complete body of the entry including the first line.final String
Filename in which the entry was found.final String
First line of the entry.final long
Line number of first line of entry.final boolean
True if this is a short entry (blank-line-separated). -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetDescription
(@Nullable Pattern re) Returns a substring of the entry body that matches the specified regular expression.
-
Field Details
-
firstLine
First line of the entry. -
body
Complete body of the entry including the first line. -
shortEntry
public final boolean shortEntryTrue if this is a short entry (blank-line-separated). -
filename
Filename in which the entry was found. -
lineNumber
public final long lineNumberLine number of first line of entry.
-
-
Constructor Details
-
Entry
Create an entry.- Parameters:
firstLine
- first line of the entrybody
- complete body of the entry including the first lineshortEntry
- true if this is a short entry (blank-line-separated)filename
- filename in which the entry was foundlineNumber
- line number of first line of entry
-
-
Method Details
-
getDescription
Returns a substring of the entry body that matches the specified regular expression. If no match is found, returns the firstLine.- Parameters:
re
- regex to match- Returns:
- a substring that matches re
-