com.unitesk.atp.text.location
Class Range

java.lang.Object
  extended by com.unitesk.atp.text.location.Range
Direct Known Subclasses:
OffsetRange

public class Range
extends Object

Range is specified by start and end positions.

Version:
$Id: Range.java,v 1.2 2004/11/15 07:53:05 all-x Exp $
Author:
Alexey Demakov
See Also:
Position

Constructor Summary
Range()
          Stub constructor sets (start,end) to the stub values.
Range(Position start, Position end)
          Creates a range with the specified start and end positions.
 
Method Summary
 boolean equals(Object obj)
          Ranges are equal if lines and columns are equal.
 Position getEnd()
          Returns the end position of this range.
 Position getStart()
          Returns the start position of this range.
 int hashCode()
           
 String toString()
          Returns the string representation of this range.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Range

public Range()
Stub constructor sets (start,end) to the stub values.

See Also:
Position.Position()

Range

public Range(Position start,
             Position end)
Creates a range with the specified start and end positions.

Parameters:
start - Start position of new range.
end - End position of new range.
Throws:
NullPointerException - if start or end is null.
Method Detail

getStart

public Position getStart()
Returns the start position of this range.

Returns:
The start position of this range.

getEnd

public Position getEnd()
Returns the end position of this range.

Returns:
The end position of this range.

toString

public String toString()
Returns the string representation of this range.

Overrides:
toString in class Object
Returns:
The string representation of this range as "${start}-${end}".
See Also:
Position.toString()

equals

public boolean equals(Object obj)
Ranges are equal if lines and columns are equal.

Overrides:
equals in class Object
Parameters:
obj - The object to compare with.

hashCode

public int hashCode()
Overrides:
hashCode in class Object
Returns:
This implementation returns line number of start position.


Copyright © 2001-2006 ISP RAS, RedVerst Group. All Rights Reserved.