org.ontoware.rdf2go.model.node.impl
Class URIImpl

java.lang.Object
  extended by org.ontoware.rdf2go.model.node.impl.ResourceImpl
      extended by org.ontoware.rdf2go.model.node.impl.URIImpl
All Implemented Interfaces:
java.lang.Comparable<Node>, Node, NodeOrVariable, Resource, ResourceOrVariable, URI, UriOrVariable

public class URIImpl
extends ResourceImpl
implements URI


Constructor Summary
URIImpl(java.lang.String uriString)
          Checks uri for validity and creates
URIImpl(java.lang.String uriString, boolean createURIWithChecking)
           
 
Method Summary
 BlankNode asBlankNode()
          A convenience method for a cast to org.ontoware.rdf2go.model.node.BlankNode
 java.net.URI asJavaURI()
          Convenience method to return the URI as a java.net.URI.
 URI asURI()
          A convenience method for a cast to org.ontoware.rdf2go.model.node.URI
 int compareTo(Node other)
           
static URI create(java.lang.String uriString)
          Deprecated. use the constructors instead
static URI createURIWithoutChecking(java.lang.String uriString)
          Deprecated. use the constructors instead
 boolean equals(java.lang.Object other)
           
 int hashCode()
           
 java.net.URI toJavaURI()
           
 java.lang.String toSPARQL()
          A convenience function to create SPARQL queries from nodes
 java.lang.String toString()
           
 
Methods inherited from class org.ontoware.rdf2go.model.node.impl.ResourceImpl
asBoolean, asDatatypeLiteral, asDate, asInt, asLanguageTagLiteral, asLiteral, asResource, asString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.ontoware.rdf2go.model.node.Node
asDatatypeLiteral, asLanguageTagLiteral, asLiteral, asResource
 

Constructor Detail

URIImpl

public URIImpl(java.lang.String uriString)
Checks uri for validity and creates

Parameters:
uriString -
Throws:
java.lang.IllegalArgumentException - if the uri is not valid and createURIWithChecking is true

URIImpl

public URIImpl(java.lang.String uriString,
               boolean createURIWithChecking)
Parameters:
uriString -
createURIWithChecking - if true, checks for valid uri
Throws:
java.lang.IllegalArgumentException - if the uri is not valid and createURIWithChecking is true
Method Detail

create

public static URI create(java.lang.String uriString)
Deprecated. use the constructors instead

This method is deprecated. Just use new URIImpl(uriString) instead.

Parameters:
uriString -
Returns:
a URI

createURIWithoutChecking

public static URI createURIWithoutChecking(java.lang.String uriString)
Deprecated. use the constructors instead

This method is deprecated. Just use new URIImpl(uriString,false) instead.

Parameters:
uriString -
Returns:
a URI

toString

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

asURI

public URI asURI()
          throws java.lang.ClassCastException
Description copied from interface: Node
A convenience method for a cast to org.ontoware.rdf2go.model.node.URI

Specified by:
asURI in interface Node
Returns:
this Node casted as a URI
Throws:
java.lang.ClassCastException - if the node is not a URI

asBlankNode

public BlankNode asBlankNode()
                      throws java.lang.ClassCastException
Description copied from interface: Node
A convenience method for a cast to org.ontoware.rdf2go.model.node.BlankNode

Specified by:
asBlankNode in interface Node
Returns:
this Node casted as a BlankNode
Throws:
java.lang.ClassCastException - if the node is not a BlankNode

equals

public boolean equals(java.lang.Object other)
Specified by:
equals in class ResourceImpl

toJavaURI

public java.net.URI toJavaURI()
                       throws java.net.URISyntaxException
Throws:
java.net.URISyntaxException

hashCode

public int hashCode()
Specified by:
hashCode in class ResourceImpl

compareTo

public int compareTo(Node other)
Specified by:
compareTo in interface java.lang.Comparable<Node>

toSPARQL

public java.lang.String toSPARQL()
Description copied from interface: Node
A convenience function to create SPARQL queries from nodes

Specified by:
toSPARQL in interface Node
Returns:
this node in SPARQL syntax. A URI is wrapped in '<' and '>'. A literal is wrapped in '"' chars and escaped.

asJavaURI

public java.net.URI asJavaURI()
Description copied from interface: URI
Convenience method to return the URI as a java.net.URI.

Specified by:
asJavaURI in interface URI
Returns:
this URI as a java.net.URI


Copyright © 2005-2008 FZI - Forschungszentrum Informatik | Karlsruhe | Germany. All Rights Reserved.