|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Factory for handling a particular implementation of a Taxon.
Method Summary | |
Taxon |
addChild(Taxon parent,
Taxon child)
Add a taxon as a child to a parent. |
Taxon |
createTaxon(java.lang.String scientificName,
java.lang.String commonName)
Create a new orphan Taxon with a given scientific and common name. |
java.lang.String |
getName()
Name for this TaxonFactory. |
Taxon |
getRoot()
Retrieve the root upon which all rooted Taxon that this factory knows about are rooted. |
Taxon |
importTaxon(Taxon source)
Import a Taxon and all its children into the implementation provided by this factory. |
Taxon |
removeChild(Taxon parent,
Taxon child)
Remove a Taxon as a child to this one. |
Taxon |
search(java.lang.Object id)
Retrieve a Taxon that matches some ID. |
Method Detail |
public java.lang.String getName()
Name for this TaxonFactory.
public Taxon importTaxon(Taxon source)
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.
source
- the Taxon to copy
public Taxon getRoot()
Retrieve the root upon which all rooted Taxon that this factory knows about are rooted.
public Taxon search(java.lang.Object id)
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.
id
- the Object identifying a Taxon
public Taxon createTaxon(java.lang.String scientificName, java.lang.String commonName)
Create a new orphan Taxon with a given scientific and common name.
scientificName
- the scientificName to give the TaxoncommonName
- the common name to give the Taxon
public Taxon addChild(Taxon parent, Taxon child) throws ChangeVetoException, CircularReferenceException
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.
parent
- the parent Taxon to add the child tochild
- the Taxon to add as a child
ChangeVetoException
- if for any reason the child can't be added
CircularReferenceException
- if child is this Taxon or any
of its parentspublic Taxon removeChild(Taxon parent, Taxon child) throws ChangeVetoException
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.
parent
- the parent Taxon to remove the child fromchild
- the Taxon to remove as a child
ChangeVetoException
- if for any reason the child can't be
removed
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |