Package org.biojava.utils.candy
Interface CandyVocabulary
-
- All Superinterfaces:
EventListener,PropertyChangeListener
public interface CandyVocabulary extends PropertyChangeListener
This interface defines functionality of a controlled vocabulary. The implementation is supposed to behave as a Java bean (regarding accessing vocabulary properties).
Each vocabulary consists of (usually many) vocabulary entries which are represented by
CandyEntries.- Version:
- $Id$
- Author:
- Martin Senger, Matthew Pocock
-
-
Field Summary
Fields Modifier and Type Field Description static StringCANDIES_NOT_SORTEDA property name.static StringPROP_CASE_SENSITIVEA property name.static StringPROP_ENTRY_COUNTA property name.static StringPROP_VOCAB_DESCA property name.static StringPROP_VOCAB_NAMEA property name.static StringPROP_VOCAB_VERSIONA property name.static StringPROP_VOCABULARYA property name.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleancontains(String name)It checks if a given entry exists in this vocabulary.voiddestroy()It frees all resources related to this vocabulary.EnumerationgetAllEntries()It returns all available vocabulary entries.EnumerationgetAllNames()It return all names (entry identifiers) available in this vocabulary.intgetCount()It returns a number of entries contained in this vocabulary.StringgetDescription()It returns a description of this vocabulary.CandyEntrygetEntryByName(String name)It returns a selected vocabulary entry.StringgetName()It returns a name of this vocabulary.StringgetVersion()It returns a vesrion of this vocabulary.booleanisCaseSensitive()It returns true if the vocabulary entries should be considered as case-sensitive.-
Methods inherited from interface java.beans.PropertyChangeListener
propertyChange
-
-
-
-
Field Detail
-
PROP_VOCAB_NAME
static final String PROP_VOCAB_NAME
A property name. Its value is a name of this vocabulary.- See Also:
- Constant Field Values
-
PROP_VOCAB_DESC
static final String PROP_VOCAB_DESC
A property name. Its value is a short description of the whole vocabulary.- See Also:
- Constant Field Values
-
PROP_VOCAB_VERSION
static final String PROP_VOCAB_VERSION
A property name. Its value contains a version of this vocabulary.- See Also:
- Constant Field Values
-
PROP_CASE_SENSITIVE
static final String PROP_CASE_SENSITIVE
A property name. Its boolean value is true if the vocabulary entries names should be considered as case-sensitive.- See Also:
- Constant Field Values
-
PROP_ENTRY_COUNT
static final String PROP_ENTRY_COUNT
A property name. Its value is a number of vocabulary entries in this vocabulary.- See Also:
- Constant Field Values
-
PROP_VOCABULARY
static final String PROP_VOCABULARY
A property name. Its type isCandyVocabularyand it can be used to set an entire vocabulary. An implementation may use it together with an empty constructor.- See Also:
- Constant Field Values
-
CANDIES_NOT_SORTED
static final String CANDIES_NOT_SORTED
A property name.
An implementation may use this boolean property to make sure that returned vocabulary entries are in the same order as they were read from its original source.
- See Also:
- Constant Field Values
-
-
Method Detail
-
contains
boolean contains(String name) throws CandyException
It checks if a given entry exists in this vocabulary.- Parameters:
name- of a vocabulary entry to be checked- Returns:
- true if the given entry exists in this vocabulary
- Throws:
CandyException- if the vocabulary is suddenly not available
-
getEntryByName
CandyEntry getEntryByName(String name) throws CandyException
It returns a selected vocabulary entry.- Parameters:
name- a name of a vocabulary entry to be looked up- Returns:
- a vocabulary entry
- Throws:
CandyException- when the given vocabulary entry does not exist- See Also:
getAllEntries
-
getAllEntries
Enumeration getAllEntries() throws CandyException
It returns all available vocabulary entries.- Returns:
- an Enumeration object containing all available entries
- Throws:
CandyException- if the vocabulary is suddenly not available- See Also:
getEntryByName
-
getAllNames
Enumeration getAllNames() throws CandyException
It return all names (entry identifiers) available in this vocabulary.- Returns:
- an Enumeration object containing all available names
- Throws:
CandyException- if the vocabulary is suddenly not available
-
destroy
void destroy() throws CandyException
It frees all resources related to this vocabulary.- Throws:
CandyException- if the vocabulary is suddenly not available
-
getName
String getName() throws CandyException
It returns a name of this vocabulary. The name should be unique within aCandyFinderinstance who delivers this vocabulary.- Throws:
CandyException
-
getDescription
String getDescription() throws CandyException
It returns a description of this vocabulary.- Throws:
CandyException
-
getVersion
String getVersion() throws CandyException
It returns a vesrion of this vocabulary.- Throws:
CandyException
-
getCount
int getCount() throws CandyException
It returns a number of entries contained in this vocabulary.- Throws:
CandyException
-
isCaseSensitive
boolean isCaseSensitive() throws CandyException
It returns true if the vocabulary entries should be considered as case-sensitive.- Throws:
CandyException
-
-