org.biojava.utils.candy
Interface CandyVocabulary

All Superinterfaces:
java.util.EventListener, java.beans.PropertyChangeListener

public interface CandyVocabulary
extends java.beans.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: CandyVocabulary.java,v 1.3 2002/11/27 22:03:12 mrp Exp $
Author:
Martin Senger, Matthew Pocock

Field Summary
static java.lang.String CANDIES_NOT_SORTED
           A property name.
static java.lang.String PROP_CASE_SENSITIVE
          A property name.
static java.lang.String PROP_ENTRY_COUNT
          A property name.
static java.lang.String PROP_VOCAB_DESC
          A property name.
static java.lang.String PROP_VOCAB_NAME
          A property name.
static java.lang.String PROP_VOCAB_VERSION
          A property name.
static java.lang.String PROP_VOCABULARY
          A property name.
 
Method Summary
 boolean contains(java.lang.String name)
          It checks if a given entry exists in this vocabulary.
 void destroy()
          It frees all resources related to this vocabulary.
 java.util.Enumeration getAllEntries()
          It returns all available vocabulary entries.
 java.util.Enumeration getAllNames()
          It return all names (entry identifiers) available in this vocabulary.
 int getCount()
          It returns a number of entries contained in this vocabulary.
 java.lang.String getDescription()
          It returns a description of this vocabulary.
 CandyEntry getEntryByName(java.lang.String name)
          It returns a selected vocabulary entry.
 java.lang.String getName()
          It returns a name of this vocabulary.
 java.lang.String getVersion()
          It returns a vesrion of this vocabulary.
 boolean isCaseSensitive()
          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

public static final java.lang.String PROP_VOCAB_NAME
A property name. Its value is a name of this vocabulary.

See Also:
Constant Field Values

PROP_VOCAB_DESC

public static final java.lang.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

public static final java.lang.String PROP_VOCAB_VERSION
A property name. Its value contains a version of this vocabulary.

See Also:
Constant Field Values

PROP_CASE_SENSITIVE

public static final java.lang.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

public static final java.lang.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

public static final java.lang.String PROP_VOCABULARY
A property name. Its type is CandyVocabulary and 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

public static final java.lang.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

public boolean contains(java.lang.String name)
                 throws NestedException
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:
NestedException - if the vocabulary is suddenly not available

getEntryByName

public CandyEntry getEntryByName(java.lang.String name)
                          throws NestedException
It returns a selected vocabulary entry.

Parameters:
name - a name of a vocabulary entry to be looked up
Returns:
a vocabulary entry
Throws:
NestedException - when the given vocabulary entry does not exist
See Also:
getAllEntries

getAllEntries

public java.util.Enumeration getAllEntries()
                                    throws NestedException
It returns all available vocabulary entries.

Returns:
an Enumeration object containing all available entries
Throws:
NestedException - if the vocabulary is suddenly not available
See Also:
getEntryByName

getAllNames

public java.util.Enumeration getAllNames()
                                  throws NestedException
It return all names (entry identifiers) available in this vocabulary.

Returns:
an Enumeration object containing all available names
Throws:
NestedException - if the vocabulary is suddenly not available

destroy

public void destroy()
             throws NestedException
It frees all resources related to this vocabulary.

Throws:
NestedException - if the vocabulary is suddenly not available

getName

public java.lang.String getName()
                         throws NestedException
It returns a name of this vocabulary. The name should be unique within a CandyFinder instance who delivers this vocabulary.

Throws:
NestedException

getDescription

public java.lang.String getDescription()
                                throws NestedException
It returns a description of this vocabulary.

Throws:
NestedException

getVersion

public java.lang.String getVersion()
                            throws NestedException
It returns a vesrion of this vocabulary.

Throws:
NestedException

getCount

public int getCount()
             throws NestedException
It returns a number of entries contained in this vocabulary.

Throws:
NestedException

isCaseSensitive

public boolean isCaseSensitive()
                        throws NestedException
It returns true if the vocabulary entries should be considered as case-sensitive.

Throws:
NestedException