nu.validator.source
Class Location

java.lang.Object
  extended by 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

Field Summary
private  int column
           
private  int line
           
private  SourceCode owner
           
 
Constructor Summary
Location(SourceCode owner, int line, int column)
           
 
Method Summary
 int compareTo(Location o)
           
 boolean equals(Object obj)
           
 int getColumn()
          Returns the column.
 int getLine()
          Returns the line.
 int hashCode()
           
(package private)  Location next()
           
(package private)  Location prev()
           
(package private)  Location step(int offset)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

owner

private final SourceCode owner

line

private final int line

column

private final int column
Constructor Detail

Location

Location(SourceCode owner,
         int line,
         int column)
Parameters:
line -
column -
Method Detail

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()