org.openrdf.model
Interface URI

All Superinterfaces:
Resource, Serializable, Value
All Known Implementing Classes:
MemURI, NativeURI, RdbmsURI, URIImpl

public interface URI
extends Resource

A URI. A URI consists of a namespace and a local name, which are derived from a URI string by splitting it in two using the following algorithm:

The last step should never fail as every legal (full) URI contains at least one ':' character to seperate the scheme from the rest of the URI. The implementation should check this upon object creation.

See Also:
URIUtil.getLocalNameIndex(String)

Method Summary
 boolean equals(Object o)
          Compares a URI object to another object.
 String getLocalName()
          Gets the local name of this URI.
 String getNamespace()
          Gets the namespace of this URI.
 int hashCode()
          The hash code of a URI is defined as the hash code of its String-representation: toString().hashCode.
 String toString()
          Returns the String-representation of this URI.
 
Methods inherited from interface org.openrdf.model.Value
stringValue
 

Method Detail

toString

String toString()
Returns the String-representation of this URI.

Overrides:
toString in class Object
Returns:
The String-representation of this URI.

getNamespace

String getNamespace()
Gets the namespace of this URI. The namespace is defined as per the algorithm described in the class documentation.

Returns:
The URI's namespace.

getLocalName

String getLocalName()
Gets the local name of this URI. The local name is defined as per the algorithm described in the class documentation.

Returns:
The URI's local name.

equals

boolean equals(Object o)
Compares a URI object to another object.

Overrides:
equals in class Object
Parameters:
o - The object to compare this URI to.
Returns:
true if the other object is an instance of URI and their String-representations are equal, false otherwise.

hashCode

int hashCode()
The hash code of a URI is defined as the hash code of its String-representation: toString().hashCode.

Overrides:
hashCode in class Object
Returns:
A hash code for the URI.


Copyright © 2001-2012 Aduna. All Rights Reserved.