org.jface.stepmt.core
Class Interval

java.lang.Object
  extended byorg.jface.stepmt.core.Interval

public class Interval
extends java.lang.Object

Represents an interval inside a String.

Version:
$Id: Interval.java,v 1.2 2004/02/07 11:24:11 powerpete Exp $
Author:
M. Petersen
See Also:
Pattern

Constructor Summary
Interval(int start, int length)
          Creates a new Interval at the given start index with the given length.
 
Method Summary
 int indexAfter()
          Returns the index after this Interval.
 Interval merge(Interval interval)
          Merges this Interval with the given Interval.
 java.lang.String textAfter(java.lang.String text)
          Returns the text after this Interval.
 java.lang.String textBefore(java.lang.String text)
          Returns the text before this Interval.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Interval

public Interval(int start,
                int length)
Creates a new Interval at the given start index with the given length.

Parameters:
start - The start index.
length - The length of the Interval.
Method Detail

textBefore

public java.lang.String textBefore(java.lang.String text)
Returns the text before this Interval.

Parameters:
text - The text used to cut out the text before this Interval.
Returns:
The text before this Interval.

textAfter

public java.lang.String textAfter(java.lang.String text)
Returns the text after this Interval.

Parameters:
text - The text used to cut out the text after this Interval.
Returns:
The text after this Interval.

merge

public Interval merge(Interval interval)
Merges this Interval with the given Interval. The result will be an Interval spanning both Intervals.

Parameters:
interval - The other Interval.
Returns:
The merged Interval.

indexAfter

public int indexAfter()
Returns the index after this Interval.

Returns:
The index after this Interval.


Copyright © 2003-2004 jface.org. All Rights Reserved.