de.topicmapslab.majortom.core
Class LocatorImpl

java.lang.Object
  extended by de.topicmapslab.majortom.core.LocatorImpl
All Implemented Interfaces:
de.topicmapslab.majortom.model.core.ILocator, java.io.Serializable, java.lang.Comparable<LocatorImpl>, org.tmapi.core.Locator

public class LocatorImpl
extends java.lang.Object
implements de.topicmapslab.majortom.model.core.ILocator, java.lang.Comparable<LocatorImpl>

Base Implementation of ILocator.

Author:
Sven Krosse
See Also:
Serialized Form

Field Summary
private  java.lang.String id
           
private  java.lang.String reference
           
private static long serialVersionUID
           
private static java.lang.String THE_IRI_IS_RELATIVE
           
private  java.net.URI uri
           
 
Constructor Summary
LocatorImpl(java.lang.String reference)
          constructor
LocatorImpl(java.lang.String reference, java.lang.String id)
          constructor
LocatorImpl(java.net.URI uri)
          constructor
 
Method Summary
 int compareTo(LocatorImpl o)
          
 boolean equals(java.lang.Object obj)
          
 java.lang.String getId()
           
 java.lang.String getReference()
          
 int hashCode()
          
 org.tmapi.core.Locator resolve(java.lang.String reference)
          
 java.lang.String toExternalForm()
          
 java.lang.String toString()
          
 java.net.URI toUri()
          
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

THE_IRI_IS_RELATIVE

private static final java.lang.String THE_IRI_IS_RELATIVE
See Also:
Constant Field Values

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values

uri

private final java.net.URI uri

reference

private final java.lang.String reference

id

private final java.lang.String id
Constructor Detail

LocatorImpl

public LocatorImpl(java.lang.String reference)
            throws org.tmapi.core.MalformedIRIException
constructor

Parameters:
reference - the reference
Throws:
org.tmapi.core.MalformedIRIException

LocatorImpl

public LocatorImpl(java.lang.String reference,
                   java.lang.String id)
            throws org.tmapi.core.MalformedIRIException
constructor

Parameters:
reference - the reference
Throws:
org.tmapi.core.MalformedIRIException

LocatorImpl

public LocatorImpl(java.net.URI uri)
            throws org.tmapi.core.MalformedIRIException
constructor

Parameters:
uri - the URI
Throws:
org.tmapi.core.MalformedIRIException
Method Detail

equals

public boolean equals(java.lang.Object obj)

Specified by:
equals in interface org.tmapi.core.Locator
Overrides:
equals in class java.lang.Object

toUri

public java.net.URI toUri()
                   throws java.net.URISyntaxException

Specified by:
toUri in interface de.topicmapslab.majortom.model.core.ILocator
Throws:
java.net.URISyntaxException

getReference

public java.lang.String getReference()

Specified by:
getReference in interface org.tmapi.core.Locator

resolve

public org.tmapi.core.Locator resolve(java.lang.String reference)
                               throws org.tmapi.core.MalformedIRIException

Specified by:
resolve in interface org.tmapi.core.Locator
Throws:
org.tmapi.core.MalformedIRIException

toExternalForm

public java.lang.String toExternalForm()

Specified by:
toExternalForm in interface org.tmapi.core.Locator

toString

public java.lang.String toString()

Overrides:
toString in class java.lang.Object

hashCode

public int hashCode()

Specified by:
hashCode in interface org.tmapi.core.Locator
Overrides:
hashCode in class java.lang.Object

getId

public java.lang.String getId()
Specified by:
getId in interface de.topicmapslab.majortom.model.core.ILocator
Returns:
the id

compareTo

public int compareTo(LocatorImpl o)

Specified by:
compareTo in interface java.lang.Comparable<LocatorImpl>