Package org.codehaus.commons.compiler
Class Location
- java.lang.Object
-
- org.codehaus.commons.compiler.Location
-
- All Implemented Interfaces:
java.io.Serializable
public class Location extends java.lang.Object implements java.io.Serializable
Represents 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 private short
columnNumber
private short
lineNumber
static Location
NOWHERE
Representation of an unspecified location.private java.lang.String
optionalFileName
-
Constructor Summary
Constructors Constructor Description Location(java.lang.String optionalFileName, short lineNumber, short columnNumber)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description short
getColumnNumber()
java.lang.String
getFileName()
short
getLineNumber()
java.lang.String
toString()
Converts thisLocation
into an english text, like 'File Main.java, Line 23, Column 79
'.
-
-
-
Field Detail
-
NOWHERE
public static final Location NOWHERE
Representation of an unspecified location.
-
optionalFileName
private final java.lang.String optionalFileName
-
lineNumber
private final short lineNumber
-
columnNumber
private final short columnNumber
-
-
Constructor Detail
-
Location
public Location(java.lang.String optionalFileName, short lineNumber, short columnNumber)
- Parameters:
optionalFileName
- A human-readable indication where the document related to thisLocation
can be found
-
-
Method Detail
-
getFileName
public java.lang.String getFileName()
- Returns:
- The "file name" associated with this location, or
null
-
getLineNumber
public short getLineNumber()
- Returns:
- The line number associated with this location, or -1
-
getColumnNumber
public short getColumnNumber()
- Returns:
- The column number associated with this location, or -1
-
toString
public java.lang.String toString()
Converts thisLocation
into an english text, like 'File Main.java, Line 23, Column 79
'.- Overrides:
toString
in classjava.lang.Object
-
-