net.percederberg.mibble

## Class FileLocation

- java.lang.Object
- - net.percederberg.mibble.FileLocation

- Direct Known Subclasses:
    MibFileRef

      public class FileLocation
      extends java.lang.Object

  A file location. This class contains a reference to an exact location inside a text file.
  Since:
    2.0

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected int` | `column` The column number.
    `protected java.io.File` | `file` The file name.
    `protected int` | `line` The line number.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `FileLocation(java.io.File file)` Creates a new file location without an exact line or column reference.
    `FileLocation(java.io.File file, int line, int column)` Creates a new file location.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `getColumnNumber()` Returns the column number.
    `java.io.File` | `getFile()` Returns the file name.
    `int` | `getLineNumber()` Returns the line number.
    `java.lang.String` | `readLine()` Reads the specified line from the file.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### file

          protected java.io.File file

      The file name.

    - #### line

          protected int line

      The line number.

    - #### column

          protected int column

      The column number.

  - ### Constructor Detail

    - #### FileLocation

          public FileLocation(java.io.File file)

      Creates a new file location without an exact line or column reference.
      Parameters:
        `file` - the file name

    - #### FileLocation

          public FileLocation(java.io.File file,
                      int line,
                      int column)

      Creates a new file location.
      Parameters:
        `file` - the file name
        `line` - the line number
        `column` - the column number

  - ### Method Detail

    - #### getFile

          public java.io.File getFile()

      Returns the file name.
      Returns:
        the file name

    - #### getLineNumber

          public int getLineNumber()

      Returns the line number.
      Returns:
        the line number

    - #### getColumnNumber

          public int getColumnNumber()

      Returns the column number.
      Returns:
        the column number

    - #### readLine

          public java.lang.String readLine()

      Reads the specified line from the file. If the file couldn't be opened or read correctly, null will be returned. The line will NOT contain the terminating '\n' character. This method takes special care to only count the linefeed (LF, 0x0A) character as a valid newline.
      Returns:
        the line read, or null if not found