Class Span

java.lang.Object
  |
  +--Span

public class Span
extends java.lang.Object

A Span is an object that corresponds to a range of an Amalgamation; it returns one or more ranges of a target text. For instance:

 AMALGAMATION: "ABCDE"
 TARGET:       "<X>AB<Y>CD</Y>E</X>"
 

A SPAN on 1..3 ("BCD") will return the following ranges of the TARGET:

4..4 ("B"), 8..9 ("CD")

[N.B. that both start and end are inclusive.]

Version:
$03/01/31 10:52:48 mdh$
Author:
Malcolm D. Hyman

Constructor Summary
Span(Amalgamation a, int start, int end)
           
 
Method Summary
 Amalgamation getAmalgamation()
          Returns the Amalgamation for this Span.
 boolean hasNext()
          Returns true of the Span contains more ranges.
 Range next()
          Returns next range in Span.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Span

public Span(Amalgamation a,
            int start,
            int end)
Method Detail

hasNext

public boolean hasNext()
Returns true of the Span contains more ranges.
Returns:
true if Span contains more ranges

next

public Range next()
Returns next range in Span.
Returns:
next range in Span.

getAmalgamation

public Amalgamation getAmalgamation()
Returns the Amalgamation for this Span.
Returns:
Amalgamation for this Span