001/*
002 *                    BioJava development code
003 *
004 * This code may be freely distributed and modified under the
005 * terms of the GNU Lesser General Public Licence.  This should
006 * be distributed with the code.  If you do not have a copy,
007 * see:
008 *
009 *      http://www.gnu.org/copyleft/lesser.html
010 *
011 * Copyright for this code is held jointly by the individual
012 * authors.  These should be listed in @author doc comments.
013 *
014 * For more information on the BioJava project and its aims,
015 * or to join the biojava-l mailing list, visit the home page
016 * at:
017 *
018 *      http://www.biojava.org/
019 *
020 */
021package org.biojava.bio.taxa;
022
023import java.util.Collections;
024import java.util.Set;
025
026/**
027 * A no-frills implementatation of Taxon.
028 *
029 * <p>A TaxonFactory implementation will probably wish to sub-class
030 * this and add package-private accessors for the parent and children
031 * fields as well as a pacakge-private constructor.</p>
032 *
033 * @author Matthew Pocock
034 * @deprecated replaced by classes in {@link org.biojavax.bio.taxa org.biojavax.bio.taxa}
035 */
036public class SimpleTaxon extends AbstractTaxon {
037  protected Taxon parent;
038  protected Set children;
039  
040  protected SimpleTaxon() { super(); }
041  
042  /**
043   * Create a new instance with no parent, no children and given
044   * scientific and common names.
045   */
046  protected SimpleTaxon(String scientificName, String commonName) {
047    super(scientificName, commonName);
048  }
049  
050  public Taxon getParent() {
051    return parent;
052  }
053  
054  void setParent(Taxon parent) {
055    this.parent = parent;
056  }
057  
058  public Set getChildren() {
059    if(children != null) {
060      return children;
061    } else {
062      return Collections.EMPTY_SET;
063    }
064  }
065}