Package org.codehaus.commons.compiler

# Class Location

java.lang.Object
org.codehaus.commons.compiler.Location

All Implemented Interfaces:
  `Serializable`

public class Location extends Object implements Serializable
Immutable representation of the location of a character in a document, as defined by an (optional) file name, a line number and a column number.

See Also:
  - Serialized Form

## Field Summary

Fields
Modifier and Type
Field
Description
`static final Location`
`NOWHERE`
Representation of an unspecified location.

## Constructor Summary

Constructors
Constructor
Description
`Location(String fileName, int lineNumber, int columnNumber)`

## Method Summary

Modifier and Type
Method
Description
`int`
`getColumnNumber()`
`String`
`getFileName()`
`int`
`getLineNumber()`
`String`
`toString()`
Converts this `Location` into an english text, like '`File Main.java, Line 23, Column 79`'.

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

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

## Field Details

### NOWHERE

public static final Location NOWHERE
Representation of an unspecified location.

## Constructor Details

### Location

public Location(@Nullable String fileName, int lineNumber, int columnNumber)

Parameters:
  `fileName` - A human-readable indication where the document related to this `Location` can be found

## Method Details

### getFileName

@Nullable public String getFileName()

Returns:
  The "file name" associated with this location, or `null`

### getLineNumber

public int getLineNumber()

Returns:
  The line number associated with this location, or -1

### getColumnNumber

public int getColumnNumber()

Returns:
  The column number associated with this location, or -1

### toString

public String toString()
Converts this `Location` into an english text, like '`File Main.java, Line 23, Column 79`'.

Overrides:
  `toString` in class `Object`