nu.validator.source
Class Location
java.lang.Object
nu.validator.source.Location
- All Implemented Interfaces:
- Cloneable, Comparable<Location>
public final class Location
- extends Object
- implements Comparable<Location>, Cloneable
Immutable source location with zero-based indexes.
Cannot point to a line break.
- Version:
- $Id$
- Author:
- hsivonen
owner
private final SourceCode owner
line
private final int line
column
private final int column
Location
Location(SourceCode owner,
int line,
int column)
- Parameters:
line
- column
-
compareTo
public int compareTo(Location o)
- Specified by:
compareTo
in interface Comparable<Location>
equals
public boolean equals(Object obj)
- Overrides:
equals
in class Object
- See Also:
Object.equals(java.lang.Object)
getColumn
public int getColumn()
- Returns the column.
- Returns:
- the column
getLine
public int getLine()
- Returns the line.
- Returns:
- the line
hashCode
public int hashCode()
- Overrides:
hashCode
in class Object
- See Also:
Object.hashCode()
next
Location next()
prev
Location prev()
step
Location step(int offset)
toString
public String toString()
- Overrides:
toString
in class Object
- See Also:
Object.toString()