|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.tools.ant.Location
public class Location
Stores the location of a piece of text within a file (file name, line number and column number). Note that the column number is currently ignored.
Field Summary | |
---|---|
static Location |
UNKNOWN_LOCATION
Location to use when one is needed but no information is available |
Constructor Summary | |
---|---|
Location(org.xml.sax.Locator loc)
Creates a location from the SAX locator using the system ID as the filename. |
|
Location(java.lang.String fileName)
Creates a location consisting of a file name but no line number or column number. |
|
Location(java.lang.String fileName,
int lineNumber,
int columnNumber)
Creates a location consisting of a file name, line number and column number. |
Method Summary | |
---|---|
boolean |
equals(java.lang.Object other)
Equality operation. |
int |
getColumnNumber()
|
java.lang.String |
getFileName()
|
int |
getLineNumber()
|
int |
hashCode()
Hash operation. |
java.lang.String |
toString()
Returns the file name, line number, a colon and a trailing space. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final Location UNKNOWN_LOCATION
Constructor Detail |
---|
public Location(java.lang.String fileName)
fileName
- The name of the file. May be null
,
in which case the location is equivalent to
UNKNOWN_LOCATION
.public Location(org.xml.sax.Locator loc)
loc
- Must not be null
.public Location(java.lang.String fileName, int lineNumber, int columnNumber)
fileName
- The name of the file. May be null
,
in which case the location is equivalent to
UNKNOWN_LOCATION
.lineNumber
- Line number within the file. Use 0 for unknown
positions within a file.columnNumber
- Column number within the line.Method Detail |
---|
public java.lang.String getFileName()
public int getLineNumber()
public int getColumnNumber()
public java.lang.String toString()
toString
in class java.lang.Object
"fileName:lineNumber: "
if both file name and line number are known,
"fileName: "
if only the file name is known,
and the empty string for unknown locations.public boolean equals(java.lang.Object other)
equals
in class java.lang.Object
other
- the object to compare to.
public int hashCode()
hashCode
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |