Class Utils


  • public final class Utils
    extends java.lang.Object
    Miscellaneous utility routines.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String extractContext​(java.lang.String message, int lineNumber, int column)
      Given a message consisting of several lines, displays a selected line in context, highlighting an indicated column position.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • extractContext

        public static java.lang.String extractContext​(java.lang.String message,
                                                      int lineNumber,
                                                      int column)
        Given a message consisting of several lines, displays a selected line in context, highlighting an indicated column position.
        Parameters:
        message - a message of one or more lines
        lineNumber - a line number containing a column of interest
        column - a column number, or -1 if the column is irrelevant
        Returns:
        a display consisting of 2 lines before the indicated line, the indicated line (highlighted) split at the indicated column, and two lines after the indicated line.