| 1 | // $Id$ |
|---|
| 2 | /** |
|---|
| 3 | * Copyright (C) 2007 EDIT |
|---|
| 4 | * European Distributed Institute of Taxonomy |
|---|
| 5 | * http://www.e-taxonomy.eu |
|---|
| 6 | * |
|---|
| 7 | * The contents of this file are subject to the Mozilla Public License Version 1.1 |
|---|
| 8 | * See LICENSE.TXT at the top of this package for the full license terms. |
|---|
| 9 | */ |
|---|
| 10 | |
|---|
| 11 | package eu.etaxonomy.cdm.model.taxon; |
|---|
| 12 | |
|---|
| 13 | import java.util.Set; |
|---|
| 14 | |
|---|
| 15 | import eu.etaxonomy.cdm.model.common.IAnnotatableEntity; |
|---|
| 16 | import eu.etaxonomy.cdm.model.reference.Reference; |
|---|
| 17 | |
|---|
| 18 | |
|---|
| 19 | /** |
|---|
| 20 | * @author n.hoffmann |
|---|
| 21 | * @created Sep 18, 2009 |
|---|
| 22 | * @version 1.0 |
|---|
| 23 | */ |
|---|
| 24 | public interface ITreeNode extends IAnnotatableEntity { |
|---|
| 25 | |
|---|
| 26 | /** |
|---|
| 27 | * Adds a taxon node as a child of the ITreeNode |
|---|
| 28 | * |
|---|
| 29 | * @param childNode |
|---|
| 30 | * @param citation |
|---|
| 31 | * @param microCitation |
|---|
| 32 | * @param synonymToBeUsed |
|---|
| 33 | * @return the child node |
|---|
| 34 | */ |
|---|
| 35 | public TaxonNode addChildNode(TaxonNode childNode, Reference citation, String microCitation, Synonym synonymToBeUsed); |
|---|
| 36 | |
|---|
| 37 | /** |
|---|
| 38 | * Adds a taxon as a child of the ITreeNode |
|---|
| 39 | * |
|---|
| 40 | * @param taxon |
|---|
| 41 | * @param citation |
|---|
| 42 | * @param microCitation |
|---|
| 43 | * @param synonymToBeUsed |
|---|
| 44 | * @return the child node |
|---|
| 45 | */ |
|---|
| 46 | public TaxonNode addChildTaxon(Taxon taxon, Reference citation, String microCitation, Synonym synonymToBeUsed); |
|---|
| 47 | |
|---|
| 48 | /** |
|---|
| 49 | * Whether this TreeNode has child nodes attached |
|---|
| 50 | * |
|---|
| 51 | * @return true if this node has children |
|---|
| 52 | */ |
|---|
| 53 | public boolean hasChildNodes(); |
|---|
| 54 | |
|---|
| 55 | /** |
|---|
| 56 | * This recursively removes all child nodes from this node and from this taxonomic view. |
|---|
| 57 | * |
|---|
| 58 | * TODO remove orphan nodes completely |
|---|
| 59 | * |
|---|
| 60 | * @param node |
|---|
| 61 | * @return true on success |
|---|
| 62 | */ |
|---|
| 63 | public boolean deleteChildNode(TaxonNode node); |
|---|
| 64 | |
|---|
| 65 | /** |
|---|
| 66 | * @return the citation for the parent child relationship or the tree itself |
|---|
| 67 | */ |
|---|
| 68 | public Reference getReference(); |
|---|
| 69 | |
|---|
| 70 | public Set<TaxonNode> getChildNodes(); |
|---|
| 71 | |
|---|
| 72 | /** |
|---|
| 73 | * |
|---|
| 74 | * @return the microCitation for the parent child relationship or the tree itself |
|---|
| 75 | */ |
|---|
| 76 | public abstract String getMicroReference(); |
|---|
| 77 | } |
|---|