org.semanticweb.owlapi.util
Class SimpleShortFormProvider

java.lang.Object
  extended by org.semanticweb.owlapi.util.SimpleShortFormProvider
All Implemented Interfaces:
ShortFormProvider

public class SimpleShortFormProvider
extends java.lang.Object
implements ShortFormProvider

Author: Matthew Horridge
The University Of Manchester
Bio-Health Informatics Group
Date: 18-Apr-2007

A very simple short form provider which is intended to provide human readable display names for entities. The following strategy is used: 1) If the entity URI has a fragment then that fragment is returned e.g. http://an.other.com#A would have a short form of "A". 2) If the entity URI does not have a fragment then the last segment of the URI path is used e.g. http://an.other.com/A/B would have a short form of "B". 3) If the entity URI does not have a path then the full URI is returned as a string.


Constructor Summary
SimpleShortFormProvider()
           
 
Method Summary
 void dispose()
          Disposes of the short form proivider.
 java.lang.String getShortForm(OWLEntity entity)
          Gets the short form for the specified entity.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleShortFormProvider

public SimpleShortFormProvider()
Method Detail

getShortForm

public java.lang.String getShortForm(OWLEntity entity)
Description copied from interface: ShortFormProvider
Gets the short form for the specified entity.

Specified by:
getShortForm in interface ShortFormProvider
Parameters:
entity - The entity.
Returns:
A string which represents a short rendering of the speicified entity.

dispose

public void dispose()
Description copied from interface: ShortFormProvider
Disposes of the short form proivider. This frees any resources and clears any caches.

Specified by:
dispose in interface ShortFormProvider