Class WeakTaxonFactory
- java.lang.Object
- 
- org.biojava.bio.taxa.WeakTaxonFactory
 
- 
- All Implemented Interfaces:
- TaxonFactory
 
 public class WeakTaxonFactory extends Object implements TaxonFactory Deprecated.replaced by classes inorg.biojavax.bio.taxaAn 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. - Author:
- Matthew Pocock
 
- 
- 
Field SummaryFields Modifier and Type Field Description static WeakTaxonFactoryGLOBALDeprecated.The TaxonFactory that the biojava system should use for storing the taxonomy used by swissprot and embl as in-memory objects.
 - 
Constructor SummaryConstructors Constructor Description WeakTaxonFactory(String name)Deprecated.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description TaxonaddChild(Taxon parent, Taxon child)Deprecated.Add a taxon as a child to a parent.TaxoncreateTaxon(String scientificName, String commonName)Deprecated.Create a new orphan Taxon with a given scientific and common name.StringgetName()Deprecated.Name for this TaxonFactory.TaxongetRoot()Deprecated.Retrieve the root upon which all rooted Taxon that this factory knows about are rooted.TaxonimportTaxon(Taxon taxon)Deprecated.Import a Taxon and all its children into the implementation provided by this factory.TaxonremoveChild(Taxon parent, Taxon child)Deprecated.Remove a Taxon as a child to this one.Taxonsearch(Object id)Deprecated.Retrieve a Taxon that matches some ID.
 
- 
- 
- 
Field Detail- 
GLOBALpublic static final WeakTaxonFactory GLOBAL Deprecated.The TaxonFactory that the biojava system should use for storing the taxonomy used by swissprot and embl as in-memory objects.
 
- 
 - 
Constructor Detail- 
WeakTaxonFactorypublic WeakTaxonFactory(String name) Deprecated.
 
- 
 - 
Method Detail- 
getRootpublic Taxon getRoot() Deprecated.Description copied from interface:TaxonFactoryRetrieve the root upon which all rooted Taxon that this factory knows about are rooted. - Specified by:
- getRootin interface- TaxonFactory
- Returns:
- the 'root' Taxon
 
 - 
getNamepublic String getName() Deprecated.Description copied from interface:TaxonFactoryName for this TaxonFactory. - Specified by:
- getNamein interface- TaxonFactory
- Returns:
- the name of this TaxonFactory
 
 - 
importTaxonpublic Taxon importTaxon(Taxon taxon) Deprecated.Description copied from interface:TaxonFactoryImport a Taxon and all its children into the implementation provided by this factory. The return value of this method should be .equals() and .hasCode() compatable with the taxon parameter. It may not be implemented by the same underlying implementation. - Specified by:
- importTaxonin interface- TaxonFactory
- Parameters:
- taxon- the Taxon to copy
- Returns:
- a new Taxon
 
 - 
createTaxonpublic Taxon createTaxon(String scientificName, String commonName) Deprecated.Description copied from interface:TaxonFactoryCreate a new orphan Taxon with a given scientific and common name. - Specified by:
- createTaxonin interface- TaxonFactory
- Parameters:
- scientificName- the scientificName to give the Taxon
- commonName- the common name to give the Taxon
- Returns:
- a new Taxon with no parent and no children
 
 - 
addChildpublic Taxon addChild(Taxon parent, Taxon child) Deprecated.Description copied from interface:TaxonFactoryAdd a taxon as a child to a parent. The TaxonFactory may chose to add the child directly, or make a new object which is .equals() compatable with child. The actual Taxon instance inserted into the child set is returned by the add method. - Specified by:
- addChildin interface- TaxonFactory
- Parameters:
- parent- the parent Taxon to add the child to
- child- the Taxon to add as a child
- Returns:
- the Taxon object actualy present as the child
 
 - 
removeChildpublic Taxon removeChild(Taxon parent, Taxon child) Deprecated.Description copied from interface:TaxonFactoryRemove a Taxon as a child to this one. This Taxon should attempt to remove a child that is .equals() compatable with child. If it is sucessful, it should return the Taxon instance that was removed. If not, it should return null. - Specified by:
- removeChildin interface- TaxonFactory
- Parameters:
- parent- the parent Taxon to remove the child from
- child- the Taxon to remove as a child
- Returns:
- the actual Taxon removed, or null if none were removed
 
 - 
searchpublic Taxon search(Object id) Deprecated.Description copied from interface:TaxonFactoryRetrieve a Taxon that matches some ID. This method is here out of desperation. It's nasty and should be replaced by some propper querying API. Without having different methods for every TaxonFactory I don't know what to do. All ideas appreciated. - Specified by:
- searchin interface- TaxonFactory
- Parameters:
- id- the Object identifying a Taxon
- Returns:
- the Taxon matching the ID, or null if none match
 
 
- 
 
-