Package gnu.text
Class SourceLocator.Simple
- java.lang.Object
-
- gnu.text.SourceLocator.Simple
-
- All Implemented Interfaces:
SourceLocator
,SourceLocator
,Locator
- Direct Known Subclasses:
Declaration
,SourceError
,SourceMessages
- Enclosing interface:
- SourceLocator
public static class SourceLocator.Simple extends Object implements SourceLocator
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface gnu.text.SourceLocator
SourceLocator.Simple
-
-
Constructor Summary
Constructors Constructor Description Simple()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getColumnNumber()
Return current column number.int
getEndColumn()
Column (one-origin) of end of range; unknown/unspecified is -1.int
getEndLine()
Line number (one-origin) of end of range; unknown/unspecified is -1.String
getFileName()
Normally same as getSystemId.int
getLineNumber()
Return current line number.String
getPublicId()
int
getStartColumn()
Column (one-origin) of start of range; unknown/unspecified is -1.int
getStartLine()
Line number (one-origin) of start of range; unknown/unspecified is -1.String
getSystemId()
boolean
isRepl()
boolean
isStableSourceLocation()
True if position is unlikely to change.void
setFile(String filename)
void
setLine(int lineno)
void
setLine(int lineno, int colno)
void
setLine(String filename, int line, int column)
void
setLocation(SourceLocator location)
-
-
-
Field Detail
-
filename
protected String filename
-
position
protected long position
-
-
Method Detail
-
getFileName
public String getFileName()
Description copied from interface:SourceLocator
Normally same as getSystemId.- Specified by:
getFileName
in interfaceSourceLocator
-
isRepl
public boolean isRepl()
-
getPublicId
public String getPublicId()
- Specified by:
getPublicId
in interfaceLocator
- Specified by:
getPublicId
in interfaceSourceLocator
- Specified by:
getPublicId
in interfaceSourceLocator
-
getSystemId
public String getSystemId()
- Specified by:
getSystemId
in interfaceLocator
- Specified by:
getSystemId
in interfaceSourceLocator
- Specified by:
getSystemId
in interfaceSourceLocator
-
getLineNumber
public int getLineNumber()
Description copied from interface:SourceLocator
Return current line number. Normally the same asgetStartLine()
. The "first" line is line 1; unknown is -1.- Specified by:
getLineNumber
in interfaceLocator
- Specified by:
getLineNumber
in interfaceSourceLocator
- Specified by:
getLineNumber
in interfaceSourceLocator
-
getColumnNumber
public int getColumnNumber()
Description copied from interface:SourceLocator
Return current column number. Normally the same asgetStartColumn()
. The "first" column is column 1; unknown is -1.- Specified by:
getColumnNumber
in interfaceLocator
- Specified by:
getColumnNumber
in interfaceSourceLocator
- Specified by:
getColumnNumber
in interfaceSourceLocator
-
getStartLine
public int getStartLine()
Description copied from interface:SourceLocator
Line number (one-origin) of start of range; unknown/unspecified is -1.- Specified by:
getStartLine
in interfaceSourceLocator
-
getStartColumn
public int getStartColumn()
Description copied from interface:SourceLocator
Column (one-origin) of start of range; unknown/unspecified is -1.- Specified by:
getStartColumn
in interfaceSourceLocator
-
getEndLine
public int getEndLine()
Description copied from interface:SourceLocator
Line number (one-origin) of end of range; unknown/unspecified is -1.- Specified by:
getEndLine
in interfaceSourceLocator
-
getEndColumn
public int getEndColumn()
Description copied from interface:SourceLocator
Column (one-origin) of end of range; unknown/unspecified is -1.- Specified by:
getEndColumn
in interfaceSourceLocator
-
isStableSourceLocation
public boolean isStableSourceLocation()
Description copied from interface:SourceLocator
True if position is unlikely to change. True for an expression but not an input file.- Specified by:
isStableSourceLocation
in interfaceSourceLocator
-
setFile
public void setFile(String filename)
-
setLine
public void setLine(String filename, int line, int column)
-
setLine
public void setLine(int lineno, int colno)
-
setLine
public void setLine(int lineno)
-
setLocation
public void setLocation(SourceLocator location)
-
-