Top Description Fields Constructors Methods
org.codehaus.commons.compiler

public Class Location

extends Object
implements Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable
Imports
java.io.Serializable, org.codehaus.commons.nullanalysis.Nullable

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.

Field Summary

Modifier and TypeField and Description
private final int
private final String
private final int
public static final Location
NOWHERE

Representation of an unspecified location.

Constructor Summary

AccessConstructor and Description
public
Location(String
A human-readable indication where the document related to this Location can be found
fileName
,
int lineNumber, int columnNumber)

Method Summary

Modifier and TypeMethod and Description
public int

Returns:

The column number associated with this location, or -1
getColumnNumber
()

public String

Returns:

The "file name" associated with this location, or null
getFileName
()

public int

Returns:

The line number associated with this location, or -1
getLineNumber
()

public String
toString()

Overrides java.lang.Object.toString.

Converts this Location into an english text, like 'File Main.java, Line 23, Column 79'.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

columnNumberback to summary
private final int columnNumber
fileNameback to summary
private final String fileName
Annotations
@Nullable
lineNumberback to summary
private final int lineNumber
NOWHEREback to summary
public static final Location NOWHERE

Representation of an unspecified location.

Constructor Detail

Locationback to summary
public Location(String fileName, int lineNumber, int columnNumber)
Parameters
fileName:String

A human-readable indication where the document related to this Location can be found

Method Detail

getColumnNumberback to summary
public int getColumnNumber()
Returns:int

The column number associated with this location, or -1

getFileNameback to summary
public String getFileName()
Returns:String

The "file name" associated with this location, or null

Annotations
@Nullable
getLineNumberback to summary
public int getLineNumber()
Returns:int

The line number associated with this location, or -1

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Converts this Location into an english text, like 'File Main.java, Line 23, Column 79'.

Returns:String

Doc from java.lang.Object.toString.

a string representation of the object.

Annotations
@Override