org.jrdf.graph
Class AbstractURIReference

java.lang.Object
  extended byorg.jrdf.graph.AbstractURIReference
All Implemented Interfaces:
Node, ObjectNode, PredicateNode, Serializable, SubjectNode, TypedNodeVisitable, URIReference
Direct Known Subclasses:
URIReferenceImpl

public abstract class AbstractURIReference
extends Object
implements URIReference, Serializable

A base implementation of an RDF URIReference.

Version:
$Revision: 1.1 $
Author:
Simon Raboczi, Andrew Newman
See Also:
Serialized Form

Constructor Summary
protected AbstractURIReference(URI newUri)
          Constructor.
protected AbstractURIReference(URI newUri, boolean validate)
          Constructor.
 
Method Summary
 void accept(TypedNodeVisitor visitor)
          Accept a call from a TypedNodeVisitor.
 boolean equals(Object obj)
          Indicates whether some other object is "equal to" this one.
 URI getURI()
          The URI identifiying this resource.
 int hashCode()
          Returns a hash-code value for this URI Reference.
 String toString()
          Provide a legible representation of a URI reference.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AbstractURIReference

protected AbstractURIReference(URI newUri)
Constructor. Enforces a non-null and absolute newUri parameter.

Parameters:
newUri - the URI to use in creation.
Throws:
IllegalArgumentException - if newUri is null or not absolute

AbstractURIReference

protected AbstractURIReference(URI newUri,
                               boolean validate)
Constructor. Enforces a non-null parameter. Use only for applications where enforcement of valid URIs is too expensive or not necessary.

Parameters:
newUri - the URI to use in creation.
validate - whether to enforce valid RDF URIs.
Throws:
IllegalArgumentException - if newUri is not absolute and validate is true.
Method Detail

getURI

public URI getURI()
The URI identifiying this resource.

Specified by:
getURI in interface URIReference
Returns:
the URI identifying this resource.

accept

public void accept(TypedNodeVisitor visitor)
Accept a call from a TypedNodeVisitor.

Specified by:
accept in interface TypedNodeVisitable
Parameters:
visitor - the object doing the visiting.

equals

public boolean equals(Object obj)
Description copied from interface: URIReference
Indicates whether some other object is "equal to" this one. A URI Reference is equal to another URI Reference if their URIs are equal to one another, character by character.

Specified by:
equals in interface URIReference

hashCode

public int hashCode()
Description copied from interface: URIReference
Returns a hash-code value for this URI Reference. This is the hash code of the URI.

Specified by:
hashCode in interface URIReference

toString

public String toString()
Provide a legible representation of a URI reference. Currently, just the URI of the reference.

Returns:
the uri property called toString() on.