org.openoffice.demo
Class Range

java.lang.Object
  extended by org.openoffice.demo.Range

public class Range
extends java.lang.Object

The Range class is to be used in conjunction with bookmarks. It provides the means to detect selections and provides basic set operations

Author:
mkandora

Constructor Summary
Range(int start, int end)
          Creates a Range without an identifier
Range(java.lang.String name, int start, int end)
          Creates a range with a name and a start and end index
 
Method Summary
 boolean contains(Range range)
          Returns true if this range contains another range
 int getEnd()
          gets the end of range
 java.lang.String getName()
          gets an optional identifier. used for ids
 int getStart()
          gets the start of range
 boolean match(Range range)
          Returns true, if this range exactly matches the provided range
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Range

public Range(java.lang.String name,
             int start,
             int end)
Creates a range with a name and a start and end index

Parameters:
name - the name of this range
start - the start of this range
end - the end of this range

Range

public Range(int start,
             int end)
Creates a Range without an identifier

Parameters:
start - the start index
end - the end index
Method Detail

getName

public java.lang.String getName()
gets an optional identifier. used for ids

Returns:

getStart

public int getStart()
gets the start of range

Returns:

getEnd

public int getEnd()
gets the end of range

Returns:

contains

public boolean contains(Range range)
Returns true if this range contains another range

Parameters:
range -
Returns:

match

public boolean match(Range range)
Returns true, if this range exactly matches the provided range

Parameters:
range -
Returns:
true, if exact match

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object