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
.
Modifier and Type | Field and Description |
---|---|
static String |
CANDIES_NOT_SORTED
A property name.
|
static String |
PROP_CASE_SENSITIVE
A property name.
|
static String |
PROP_ENTRY_COUNT
A property name.
|
static String |
PROP_VOCAB_DESC
A property name.
|
static String |
PROP_VOCAB_NAME
A property name.
|
static String |
PROP_VOCAB_VERSION
A property name.
|
static String |
PROP_VOCABULARY
A property name.
|
Modifier and Type | Method and Description |
---|---|
boolean |
contains(String name)
It checks if a given entry exists in this vocabulary.
|
void |
destroy()
It frees all resources related to this vocabulary.
|
Enumeration |
getAllEntries()
It returns all available vocabulary entries.
|
Enumeration |
getAllNames()
It return all names (entry identifiers) available in this vocabulary.
|
int |
getCount()
It returns a number of entries contained in this vocabulary.
|
String |
getDescription()
It returns a description of this vocabulary.
|
CandyEntry |
getEntryByName(String name)
It returns a selected vocabulary entry.
|
String |
getName()
It returns a name of this vocabulary.
|
String |
getVersion()
It returns a vesrion of this vocabulary.
|
boolean |
isCaseSensitive()
It returns true if the vocabulary entries should
be considered as case-sensitive.
|
propertyChange
static final String PROP_VOCAB_NAME
static final String PROP_VOCAB_DESC
static final String PROP_VOCAB_VERSION
static final String PROP_CASE_SENSITIVE
static final String PROP_ENTRY_COUNT
static final String PROP_VOCABULARY
CandyVocabulary
and
it can be used to set an entire vocabulary.
An implementation may use it together with an empty
constructor.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.
boolean contains(String name) throws CandyException
name
- of a vocabulary entry to be checkedCandyException
- if the vocabulary is suddenly not availableCandyEntry getEntryByName(String name) throws CandyException
name
- a name of a vocabulary entry to be looked upCandyException
- when the given vocabulary entry does not existgetAllEntries
Enumeration getAllEntries() throws CandyException
CandyException
- if the vocabulary is suddenly not availablegetEntryByName
Enumeration getAllNames() throws CandyException
CandyException
- if the vocabulary is suddenly not availablevoid destroy() throws CandyException
CandyException
- if the vocabulary is suddenly not availableString getName() throws CandyException
CandyFinder
instance who delivers this vocabulary.CandyException
String getDescription() throws CandyException
CandyException
String getVersion() throws CandyException
CandyException
int getCount() throws CandyException
CandyException
boolean isCaseSensitive() throws CandyException
CandyException
Copyright © 2014 BioJava. All rights reserved.