org.tmapi.core
Interface Locator


public interface Locator

An abstract representation of any addressing scheme. In this representation, an address (reference) is defined using a string and the reference string is specified in a particular notation. For example, the majority of network addresses are specified using the "URI" notation, and so the reference string must conform to this notation specification.


Method Summary
 boolean equals(java.lang.Object o)
          Returns true if the other object is equal to this one.
 java.lang.String getNotation()
          Returns the notation string of the locator.
 java.lang.String getReference()
          Returns the reference string portion of the locator.
 int hashCode()
          The hashCode() implementation must satisfy JDK's requirements that equal objects should return equal hashCode values.
 Locator resolveRelative(java.lang.String relative)
          Produces a new Locator object by resolving a reference string relative to the reference of this Locator.
 java.lang.String toExternalForm()
          Returns a string representation of this locator suitable for output or passing to APIs which will parse the locator anew.
 

Method Detail

getReference

public java.lang.String getReference()
Returns the reference string portion of the locator.


getNotation

public java.lang.String getNotation()
Returns the notation string of the locator.


resolveRelative

public Locator resolveRelative(java.lang.String relative)
Produces a new Locator object by resolving a reference string relative to the reference of this Locator.

Parameters:
relative - The relative reference to be resolved.
Returns:
A Locator object representing the absolute reference created by resolving relative relative to the reference of this Locator.

toExternalForm

public java.lang.String toExternalForm()
Returns a string representation of this locator suitable for output or passing to APIs which will parse the locator anew. Any special character will be escaped using the escaping conventions of the locator notation.


equals

public boolean equals(java.lang.Object o)
Returns true if the other object is equal to this one. Equality must be the result of comparing the references and notations of the two locator objects. If o is not an instance of Locator the return value is false.

Returns:
(o instanceof Locator && getReference().equals(((Locator)o).getReference()) && getNotation().equals(((Locator)o).getNotation()))

hashCode

public int hashCode()
The hashCode() implementation must satisfy JDK's requirements that equal objects should return equal hashCode values.

Returns:
hashCode for this Object