dk.brics.misc
Class Origin

java.lang.Object
  extended by dk.brics.misc.Origin
All Implemented Interfaces:
Serializable, Comparable<Origin>

public class Origin
extends Object
implements Serializable, Comparable<Origin>

Representation of source point.

See Also:
Serialized Form

Constructor Summary
Origin(String str)
          Constructs an origin object from its string representation.
Origin(String file, int line, int col)
          Constructs a new origin object.
 
Method Summary
 int compareTo(Origin o)
           
 boolean equals(Object obj)
           
 int getColumn()
          Returns the column number.
 String getFile()
          Returns the file name.
 int getLine()
          Returns the line number.
 int hashCode()
           
 String toString()
          Returns string representation of this origin.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Origin

public Origin(String str)
Constructs an origin object from its string representation.

Parameters:
str - origin

Origin

public Origin(String file,
              int line,
              int col)
Constructs a new origin object.

Parameters:
file - file name
line - line number
col - column number
Method Detail

compareTo

public int compareTo(Origin o)
Specified by:
compareTo in interface Comparable<Origin>

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

getColumn

public int getColumn()
Returns the column number.

Returns:
column number

getFile

public String getFile()
Returns the file name.

Returns:
file name

getLine

public int getLine()
Returns the line number.

Returns:
line number

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Returns string representation of this origin.

Overrides:
toString in class Object
Returns:
string


Copyright © 2005-2010 Anders Møller.