Class EntryReader.Entry

java.lang.Object
org.plumelib.util.EntryReader.Entry
Enclosing class:
EntryReader

public static class EntryReader.Entry extends Object
Descriptor for an entry (record, paragraph, etc.).
  • Field Details

    • firstLine

      public final String firstLine
      First line of the entry.
    • body

      public final String body
      Complete body of the entry including the first line.
    • shortEntry

      public final boolean shortEntry
      True if this is a short entry (blank-line-separated).
    • filename

      public final String filename
      Filename in which the entry was found.
    • lineNumber

      public final long lineNumber
      Line number of first line of entry.
  • Constructor Details

    • Entry

      public Entry(String firstLine, String body, String filename, long lineNumber, boolean shortEntry)
      Create an entry.
      Parameters:
      firstLine - first line of the entry
      body - complete body of the entry including the first line
      shortEntry - true if this is a short entry (blank-line-separated)
      filename - filename in which the entry was found
      lineNumber - line number of first line of entry
  • Method Details

    • getDescription

      public String getDescription(@Nullable Pattern re)
      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