xpointer
Class StringRange

java.lang.Object
  |
  +--xpointer.StringRange

public class StringRange
extends java.lang.Object

This class represents the string-range() XPointer function.


Constructor Summary
StringRange(Location location)
          Creates new StringRange
 
Method Summary
 org.w3c.dom.ranges.Range[] getStringRange(java.lang.String match)
          Returns a range determined by searching the string-value of the location for substrings the match the given string.
 org.w3c.dom.ranges.Range[] getStringRange(java.lang.String match, int offset)
          Returns a range determined by searching the string-value of the location for substrings the match the given string.
 org.w3c.dom.ranges.Range[] getStringRange(java.lang.String match, int offset, int length)
          Returns a range determined by searching the string-value of the location for substrings the match the given string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StringRange

public StringRange(Location location)
Creates new StringRange
Parameters:
location - the location where the matching sting is looked for
Method Detail

getStringRange

public org.w3c.dom.ranges.Range[] getStringRange(java.lang.String match,
                                                 int offset,
                                                 int length)
                                          throws javax.xml.transform.TransformerException
Returns a range determined by searching the string-value of the location for substrings the match the given string. The empty string is defined to select the entire location.
Parameters:
match - the matching string
offset - position of the first character to be in the resulting range
length - the number of characters in the resulting range
Returns:
an array of ranges which contain the matchted string

getStringRange

public org.w3c.dom.ranges.Range[] getStringRange(java.lang.String match)
                                          throws javax.xml.transform.TransformerException
Returns a range determined by searching the string-value of the location for substrings the match the given string. The empty string is defined to select the entire location. The position of the first character in the range is 1, i.e. the range starts immediatly before the first character of the matched string. The range extends to the end of the matched string.
Parameters:
match - the matching string
Returns:
an array of ranges which contain the matchted string

getStringRange

public org.w3c.dom.ranges.Range[] getStringRange(java.lang.String match,
                                                 int offset)
                                          throws javax.xml.transform.TransformerException
Returns a range determined by searching the string-value of the location for substrings the match the given string. The empty string is defined to select the entire location. The range extends to the end of the matched string. If the offset is less than 1, the resulting range starts from a position obtained counting abs(offstet)+1 positions backwards from the beginning of the matched string. If the offset is greater than the length of the matched string, a collapsed range is returned.
Parameters:
match - the matching string
offset - position of the first character to be in the resulting range
Returns:
an array of ranges which contain the matchted string