Class CachingBidirectionalShortFormProvider

java.lang.Object
org.semanticweb.owlapi.util.CachingBidirectionalShortFormProvider
All Implemented Interfaces:
BidirectionalShortFormProvider, ShortFormProvider
Direct Known Subclasses:
BidirectionalShortFormProviderAdapter

public abstract class CachingBidirectionalShortFormProvider extends Object implements BidirectionalShortFormProvider
A bidirectional short form provider that caches entity short forms. The provider has various methods to add, remove, update entities in the cache and also to rebuild the cache from scratch.
Since:
2.0.0
Author:
Matthew Horridge, The University Of Manchester, Bio-Health Informatics Group
  • Method Details

    • shortForms

      public Stream<String> shortForms()
      Description copied from interface: BidirectionalShortFormProvider
      Gets all of the short forms that are mapped to entities.
      Specified by:
      shortForms in interface BidirectionalShortFormProvider
      Returns:
      stream of the strings representing the short forms of entities for which there is a mapping.
    • add

      public void add(OWLEntity entity)
      Adds an entity to the cache.
      Parameters:
      entity - The entity to be added to the cache - the short form will automatically be generated and added to the cache.
    • entities

      public Stream<OWLEntity> entities(String shortForm)
      Description copied from interface: BidirectionalShortFormProvider
      For a given short form this method obtains the entities which have this short form.
      Specified by:
      entities in interface BidirectionalShortFormProvider
      Parameters:
      shortForm - The short form of the entities that will be retrieved.
      Returns:
      stream of entities that have the specified short form.
    • getEntity

      @Nullable public OWLEntity getEntity(String shortForm)
      Description copied from interface: BidirectionalShortFormProvider
      A convenience method which gets an entity from its short form.
      Specified by:
      getEntity in interface BidirectionalShortFormProvider
      Parameters:
      shortForm - The short form of the entity.
      Returns:
      The actual entity or null if there is no entity which has the specified short form. If the specified short form corresponds to more than one entity then an entity will be chosen by the implementation of the short form provider.
    • getShortForm

      public 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 specified entity. The returned value will not be null but might be an empty string.
    • dispose

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