Package org.semanticweb.owlapi.util
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 Summary
Modifier and TypeMethodDescriptionvoid
Adds an entity to the cache.void
dispose()
Disposes of the short form provider.For a given short form this method obtains the entities which have this short form.A convenience method which gets an entity from its short form.getShortForm
(OWLEntity entity) Gets the short form for the specified entity.Gets all of the short forms that are mapped to entities.Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.semanticweb.owlapi.util.BidirectionalShortFormProvider
getEntities, getShortForms
-
Method Details
-
shortForms
Description copied from interface:BidirectionalShortFormProvider
Gets all of the short forms that are mapped to entities.- Specified by:
shortForms
in interfaceBidirectionalShortFormProvider
- Returns:
- stream of the strings representing the short forms of entities for which there is a mapping.
-
add
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
Description copied from interface:BidirectionalShortFormProvider
For a given short form this method obtains the entities which have this short form.- Specified by:
entities
in interfaceBidirectionalShortFormProvider
- Parameters:
shortForm
- The short form of the entities that will be retrieved.- Returns:
- stream of entities that have the specified short form.
-
getEntity
Description copied from interface:BidirectionalShortFormProvider
A convenience method which gets an entity from its short form.- Specified by:
getEntity
in interfaceBidirectionalShortFormProvider
- 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
Description copied from interface:ShortFormProvider
Gets the short form for the specified entity.- Specified by:
getShortForm
in interfaceShortFormProvider
- 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 interfaceShortFormProvider
-