org.jscience.biology.taxonomy
Class WeakTaxonFactory

java.lang.Object
  extended by org.jscience.biology.taxonomy.WeakTaxonFactory
All Implemented Interfaces:
TaxonFactory

public class WeakTaxonFactory
extends java.lang.Object
implements TaxonFactory

An implementation of TaxonFactory that builds a weak in-memory Taxon tree.

This implementation holds only weak references to the Taxon instances it knows about. This means that WeakTaxonFactory may not be appropriate for situations where you wish to browse the taxon tree. It does, however, mean that massive taxa can be represented, by effectively reflecting the currently useful rooted sub-tree in memory.


Field Summary
static WeakTaxonFactory GLOBAL
          The TaxonFactory that the system should use for storing the taxonomy used by swissprot and embl as in-memory objects.
 
Constructor Summary
WeakTaxonFactory(java.lang.String name)
          Creates a new WeakTaxonFactory object.
 
Method Summary
 Taxon addChild(Taxon parent, Taxon child)
          DOCUMENT ME!
 Taxon createTaxon(java.lang.String scientificName, java.lang.String commonName)
          DOCUMENT ME!
 java.lang.String getName()
          DOCUMENT ME!
 Taxon getRoot()
          DOCUMENT ME!
 Taxon importTaxon(Taxon taxon)
          DOCUMENT ME!
 Taxon removeChild(Taxon parent, Taxon child)
          DOCUMENT ME!
 Taxon search(java.lang.Object id)
          DOCUMENT ME!
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

GLOBAL

public static final WeakTaxonFactory GLOBAL
The TaxonFactory that the system should use for storing the taxonomy used by swissprot and embl as in-memory objects.

Constructor Detail

WeakTaxonFactory

public WeakTaxonFactory(java.lang.String name)
Creates a new WeakTaxonFactory object.

Parameters:
name - DOCUMENT ME!
Throws:
java.lang.IllegalArgumentException - DOCUMENT ME!
Method Detail

getRoot

public Taxon getRoot()
DOCUMENT ME!

Specified by:
getRoot in interface TaxonFactory
Returns:
DOCUMENT ME!

getName

public java.lang.String getName()
DOCUMENT ME!

Specified by:
getName in interface TaxonFactory
Returns:
DOCUMENT ME!

importTaxon

public Taxon importTaxon(Taxon taxon)
DOCUMENT ME!

Specified by:
importTaxon in interface TaxonFactory
Parameters:
taxon - DOCUMENT ME!
Returns:
DOCUMENT ME!
Throws:
java.lang.IllegalArgumentException - DOCUMENT ME!

createTaxon

public Taxon createTaxon(java.lang.String scientificName,
                         java.lang.String commonName)
DOCUMENT ME!

Specified by:
createTaxon in interface TaxonFactory
Parameters:
scientificName - DOCUMENT ME!
commonName - DOCUMENT ME!
Returns:
DOCUMENT ME!

addChild

public Taxon addChild(Taxon parent,
                      Taxon child)
DOCUMENT ME!

Specified by:
addChild in interface TaxonFactory
Parameters:
parent - DOCUMENT ME!
child - DOCUMENT ME!
Returns:
DOCUMENT ME!
Throws:
java.lang.IllegalArgumentException - DOCUMENT ME!

removeChild

public Taxon removeChild(Taxon parent,
                         Taxon child)
DOCUMENT ME!

Specified by:
removeChild in interface TaxonFactory
Parameters:
parent - DOCUMENT ME!
child - DOCUMENT ME!
Returns:
DOCUMENT ME!
Throws:
java.lang.IllegalArgumentException - DOCUMENT ME!

search

public Taxon search(java.lang.Object id)
DOCUMENT ME!

Specified by:
search in interface TaxonFactory
Parameters:
id - DOCUMENT ME!
Returns:
DOCUMENT ME!