net.sf.saxon.om
Class DocumentURI

java.lang.Object
  extended by net.sf.saxon.om.DocumentURI

public class DocumentURI
extends Object

This class encapsulates a string used as the value of the document-uri() property of a document, together with a normalized representation of the string used for equality comparisons. The idea is that on Windows systems, document URIs are compared using case-blind comparison, but the original case is retained for display purposes.


Field Summary
static boolean CASE_BLIND_FILES
           
 
Constructor Summary
DocumentURI(String uri)
          Create a DocumentURI object that wraps a given URI
 
Method Summary
 boolean equals(Object obj)
           
 int hashCode()
           
static String normalizeURI(String uri)
          Normalize the representation of file: URIs to give better equality matching than straight string comparison.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

CASE_BLIND_FILES

public static final boolean CASE_BLIND_FILES
Constructor Detail

DocumentURI

public DocumentURI(String uri)
Create a DocumentURI object that wraps a given URI

Parameters:
uri - the URI to be wrapped. Must not be null
Throws:
NullPointerException - if uri is null
Method Detail

toString

public String toString()
Overrides:
toString in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

normalizeURI

public static String normalizeURI(String uri)
Normalize the representation of file: URIs to give better equality matching than straight string comparison. The main purpose is (a) to eliminate the distinction between "file:/" and "file:///", and (b) to normalize case in the case of Windows filenames: especially the distinction between "file:/C:" and "file:/c:".

Parameters:
uri - the URI to be normalized
Returns:
the normalized URI.


Copyright (c) 2004-2010 Saxonica Limited. All rights reserved.