|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.biojava.bio.taxa.SimpleTaxonFactory
org.biojavax.bio.taxa
public class SimpleTaxonFactory
A no-frills implementation of TaxaFactory that builds an in-memory Taxa tree.
Field Summary | |
---|---|
static SimpleTaxonFactory |
GLOBAL
Deprecated. The TaxonFactory that the biojava system should use for storing the taxonomy used by swissprot and embl as in-memory objects. |
Constructor Summary | |
---|---|
SimpleTaxonFactory(String name)
Deprecated. |
Method Summary | |
---|---|
Taxon |
addChild(Taxon parent,
Taxon child)
Deprecated. Add a taxon as a child to a parent. |
Taxon |
createTaxon(String scientificName,
String commonName)
Deprecated. Create a new orphan Taxon with a given scientific and common name. |
String |
getName()
Deprecated. Name for this TaxonFactory. |
Taxon |
getRoot()
Deprecated. Retrieve the root upon which all rooted Taxon that this factory knows about are rooted. |
Taxon |
importTaxon(Taxon taxon)
Deprecated. Import a Taxon and all its children into the implementation provided by this factory. |
Taxon |
removeChild(Taxon parent,
Taxon child)
Deprecated. Remove a Taxon as a child to this one. |
Taxon |
search(Object id)
Deprecated. Retrieve a Taxon that matches some ID. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final SimpleTaxonFactory GLOBAL
Constructor Detail |
---|
public SimpleTaxonFactory(String name)
Method Detail |
---|
public Taxon getRoot()
TaxonFactory
Retrieve the root upon which all rooted Taxon that this factory knows about are rooted.
getRoot
in interface TaxonFactory
public String getName()
TaxonFactory
Name for this TaxonFactory.
getName
in interface TaxonFactory
public Taxon importTaxon(Taxon taxon)
TaxonFactory
Import 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.
importTaxon
in interface TaxonFactory
taxon
- the Taxon to copy
public Taxon createTaxon(String scientificName, String commonName)
TaxonFactory
Create a new orphan Taxon with a given scientific and common name.
createTaxon
in interface TaxonFactory
scientificName
- the scientificName to give the TaxoncommonName
- the common name to give the Taxon
public Taxon addChild(Taxon parent, Taxon child)
TaxonFactory
Add 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.
addChild
in interface TaxonFactory
parent
- the parent Taxon to add the child tochild
- the Taxon to add as a child
public Taxon removeChild(Taxon parent, Taxon child)
TaxonFactory
Remove 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.
removeChild
in interface TaxonFactory
parent
- the parent Taxon to remove the child fromchild
- the Taxon to remove as a child
public Taxon search(Object id)
TaxonFactory
Retrieve 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.
search
in interface TaxonFactory
id
- the Object identifying a Taxon
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |