public interface CandyFinder extends PropertyChangeListener
This interface is a main entry point to a set of controlled vocabularies.
The implementation is supposed to behave as a Java bean (usually an invisible bean unless it implements some additional GUI methods which are not defined in this interface).
Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_FINDER_NAME
A default name of this (and any) finder.
|
static String |
PROP_VOCABULARY
A property name.
|
Modifier and Type | Method and Description |
---|---|
void |
connect()
It creates a connection to an object representing a vocabulary
finder, or/and it makes all necessary initialization steps
needed for further communication.
|
void |
disconnect()
It closes connection with the finder object.
|
CandyVocabulary[] |
getAllVocabularies()
It returns all available vocabularies.
|
String[] |
getAllVocabularyNames()
It returns names of all vocabularies known to this vocabulary
finder.
|
String |
getFinderName()
It returns a name of this vocabulary finder.
|
int |
getNumCount()
It returns the number of available vocabularies.
|
CandyVocabulary |
getVocabularyByName(String name)
It returns a selected vocabulary.
|
boolean |
isReady()
It checks if a vocabulary finder object is available.
|
propertyChange
static final String DEFAULT_FINDER_NAME
static final String PROP_VOCABULARY
A property name.
Its value is of type CandyVocabulary
.
It this property is set a given vocabulary becomes part of
this finder.
void connect() throws CandyException
It creates a connection to an object representing a vocabulary finder, or/and it makes all necessary initialization steps needed for further communication.
However, there should be no need to call this method explicitly, the other methods should do it automatically before they need to use the finder.
CandyException
- if the connection/initialization cannot
be establishedboolean isReady()
void disconnect()
String[] getAllVocabularyNames() throws CandyException
It returns names of all vocabularies known to this vocabulary
finder. Any of the returned names can be later used in the method
getVocabularyByName
.
CandyException
- if the finder fails to communicate
with its vocabulariesCandyVocabulary getVocabularyByName(String name) throws CandyException
name
- a name of a vocabulary to be returnedCandyException
- when the vocabulary cannot be found (likely the
given name is wrong)getAllVocabularyNames()
CandyVocabulary[] getAllVocabularies() throws CandyException
CandyException
- if the finder fails to communicate
with its vocabulariesint getNumCount() throws CandyException
CandyException
- if the finder fails to communicate
with its vocabulariesString getFinderName() throws CandyException
CandyException
- if the finder fails to return its nameCopyright © 2014 BioJava. All rights reserved.