org.openrdf.model.impl
Class URIImpl

java.lang.Object
  extended by org.openrdf.model.impl.URIImpl
All Implemented Interfaces:
java.io.Serializable, Resource, URI, Value
Direct Known Subclasses:
NativeURI

public class URIImpl
extends java.lang.Object
implements URI

The default implementation of the URI interface.

See Also:
Serialized Form

Constructor Summary
protected URIImpl()
          Creates a new, unitialized URI.
  URIImpl(java.lang.String uriString)
          Creates a new URI from the supplied string.
 
Method Summary
 boolean equals(java.lang.Object o)
          Compares a URI object to another object.
 java.lang.String getLocalName()
          Gets the local name of this URI.
 java.lang.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.
protected  void setURIString(java.lang.String uriString)
           
 java.lang.String stringValue()
          Returns the String-value of a Value object.
 java.lang.String toString()
          Returns the String-representation of this URI.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

URIImpl

protected URIImpl()
Creates a new, unitialized URI. This URI's string value needs to be set before the normal methods can be used.


URIImpl

public URIImpl(java.lang.String uriString)
Creates a new URI from the supplied string.

Parameters:
uriString - A String representing a valid, absolute URI.
Throws:
java.lang.IllegalArgumentException - If the supplied URI is not a valid (absolute) URI.
Method Detail

setURIString

protected void setURIString(java.lang.String uriString)

toString

public java.lang.String toString()
Description copied from interface: URI
Returns the String-representation of this URI.

Specified by:
toString in interface URI
Overrides:
toString in class java.lang.Object
Returns:
The String-representation of this URI.

stringValue

public java.lang.String stringValue()
Description copied from interface: Value
Returns the String-value of a Value object. This returns either a Literal's label, a URI's URI or a BNode's ID.

Specified by:
stringValue in interface Value

getNamespace

public java.lang.String getNamespace()
Description copied from interface: URI
Gets the namespace of this URI. The namespace is defined as per the algorithm described in the class documentation.

Specified by:
getNamespace in interface URI
Returns:
The URI's namespace.

getLocalName

public java.lang.String getLocalName()
Description copied from interface: URI
Gets the local name of this URI. The local name is defined as per the algorithm described in the class documentation.

Specified by:
getLocalName in interface URI
Returns:
The URI's local name.

equals

public boolean equals(java.lang.Object o)
Description copied from interface: URI
Compares a URI object to another object.

Specified by:
equals in interface URI
Overrides:
equals in class java.lang.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

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

Specified by:
hashCode in interface URI
Overrides:
hashCode in class java.lang.Object
Returns:
A hash code for the URI.


Copyright © 2001-2010 Aduna. All Rights Reserved.