org.semanticweb.owlapi.util
Class BidirectionalShortFormProviderAdapter

java.lang.Object
  extended by org.semanticweb.owlapi.util.CachingBidirectionalShortFormProvider
      extended by org.semanticweb.owlapi.util.BidirectionalShortFormProviderAdapter
All Implemented Interfaces:
BidirectionalShortFormProvider, ShortFormProvider

public class BidirectionalShortFormProviderAdapter
extends CachingBidirectionalShortFormProvider

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

A bidirectional short form provider which uses a specified short form provider to generate the bidirectional entity--shortform mappings.


Constructor Summary
BidirectionalShortFormProviderAdapter(OWLOntologyManager man, java.util.Set<OWLOntology> ontologies, ShortFormProvider shortFormProvider)
          Creates a BidirectionalShortFormProvider that maps between the entities that are referenced in the specified ontologies and the shortforms of these entities.
BidirectionalShortFormProviderAdapter(java.util.Set<OWLOntology> ontologies, ShortFormProvider shortFormProvider)
          Creates a BidirectionalShortFormProvider that maps between the entities that are referenced in the specified ontologies and the shortforms of these entities.
BidirectionalShortFormProviderAdapter(ShortFormProvider shortFormProvider)
           
 
Method Summary
 void dispose()
          Disposes of this short form provider.
protected  java.lang.String generateShortForm(OWLEntity entity)
          Generates the short form for the specified entity.
 
Methods inherited from class org.semanticweb.owlapi.util.CachingBidirectionalShortFormProvider
add, getEntities, getEntity, getShortForm, getShortForms, rebuild, remove, update
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BidirectionalShortFormProviderAdapter

public BidirectionalShortFormProviderAdapter(ShortFormProvider shortFormProvider)

BidirectionalShortFormProviderAdapter

public BidirectionalShortFormProviderAdapter(java.util.Set<OWLOntology> ontologies,
                                             ShortFormProvider shortFormProvider)
Creates a BidirectionalShortFormProvider that maps between the entities that are referenced in the specified ontologies and the shortforms of these entities.

Parameters:
ontologies - The ontologies that contain references to the entities to be mapped.
shortFormProvider - The short form provider that should be used to generate the short forms of the referenced entities.

BidirectionalShortFormProviderAdapter

public BidirectionalShortFormProviderAdapter(OWLOntologyManager man,
                                             java.util.Set<OWLOntology> ontologies,
                                             ShortFormProvider shortFormProvider)
Creates a BidirectionalShortFormProvider that maps between the entities that are referenced in the specified ontologies and the shortforms of these entities. Note that the dispose method must be called when the provider has been finished with so that the provider may remove itself as a listener from the manager.

Parameters:
ontologies - The ontologies that contain references to the entities to be mapped.
shortFormProvider - The short form provider that should be used to generate the short forms of the referenced entities.
man - This short form provider will track changes to ontologies. The provider will listen for ontology changes and update the cache of entity--shortform mappings based on whether the specified ontologies contain references to entities or not.
Method Detail

generateShortForm

protected java.lang.String generateShortForm(OWLEntity entity)
Description copied from class: CachingBidirectionalShortFormProvider
Generates the short form for the specified entity. This short form will be cached so that it can be retrieved efficiently and so that the entity can be obtained from the short form. If the short form for the entity changes then the cach must explicilty be updated using the update method.

Specified by:
generateShortForm in class CachingBidirectionalShortFormProvider
Parameters:
entity - The entity whose short form should be generated.

dispose

public void dispose()
Disposes of this short form provider. Note that this method MUST be called if the constructor that specifies an ontology manager was used.

Specified by:
dispose in interface ShortFormProvider
Overrides:
dispose in class CachingBidirectionalShortFormProvider