de.aitools.ie.decomposition
Class Span

java.lang.Object
  extended by de.aitools.ie.decomposition.Span

public class Span
extends java.lang.Object

Class for storing start and end integer offsets for a string.

Author:
bege5932, cino5392

Constructor Summary
Span(int start, int end)
          Initialises a new Span Object.
 
Method Summary
 int getEnd()
           
 int getStart()
           
 java.lang.String getSubstring(java.lang.String text)
          Retrieves the string covered by the current span of the specified text.
 int length()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Span

public Span(int start,
            int end)
Initialises a new Span Object.

Parameters:
start - start of span.
end - end of span.
Method Detail

toString

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

getSubstring

public java.lang.String getSubstring(java.lang.String text)
Retrieves the string covered by the current span of the specified text.
Be aware: The transformation is only correct with

Parameters:
text -
Returns:
the substring covered by the current span

getStart

public int getStart()
Returns:
Start index as int value.

getEnd

public int getEnd()
Returns:
End index as int value.
The position of the last character is end index -1.

length

public int length()
Returns:
The length of the part in original string.
Length = end index -start index