org.tmapi.core
Interface Locator


public interface Locator

Immutable representation of an IRI.

Version:
$Rev: 122 $ - $Date: 2009-10-01 19:08:29 +0200 (Do, 01 Okt 2009) $
Author:
The TMAPI Project

Method Summary
 boolean equals(java.lang.Object other)
          Returns true if the other object is equal to this one.
 java.lang.String getReference()
          Returns the IRI
 int hashCode()
          Returns a hash code value.
 Locator resolve(java.lang.String reference)
          Resolves the reference against this locator.
 java.lang.String toExternalForm()
          Returns the external form of the IRI.
 

Method Detail

getReference

java.lang.String getReference()
Returns the IRI

Returns:
A lexical representation of the IRI.

toExternalForm

java.lang.String toExternalForm()
Returns the external form of the IRI. Any special character will be escaped using the escaping conventions of RFC 3987

Returns:
A string representation of this locator suitable for output or passing to APIs which will parse the locator anew.

resolve

Locator resolve(java.lang.String reference)
                throws MalformedIRIException
Resolves the reference against this locator. The returned Locator represents an absolute IRI.

Parameters:
reference - The reference which should be resolved against this locator.
Returns:
A locator representing an absolute IRI.
Throws:
java.lang.IllegalArgumentException - If reference is null.
MalformedIRIException - If the provided string cannot be resolved against this locator.

equals

boolean equals(java.lang.Object other)
Returns true if the other object is equal to this one.

Overrides:
equals in class java.lang.Object
Parameters:
other - The object to compare this object against.
Returns:
(other instanceof Locator && this.getReference().equals(((Locator)other).getReference()))

hashCode

int hashCode()
Returns a hash code value. The returned hash code is equal to the hash code of the getReference() property.

Overrides:
hashCode in class java.lang.Object
Returns:
this.getReference().hashCode()