com.facetmap.simple
Class SimpleTaxonomyFacet
java.lang.Object
com.facetmap.simple.SimpleFacet
com.facetmap.simple.SimpleTaxonomyFacet
- All Implemented Interfaces:
- Facet, TaxonomyFacet
- Direct Known Subclasses:
- LinearFacet
public class SimpleTaxonomyFacet
- extends SimpleFacet
- implements TaxonomyFacet
Mutable reference implementation of TaxonomyFacet.
| Nested classes/interfaces inherited from interface com.facetmap.Facet |
Facet.Util |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SimpleTaxonomyFacet
public SimpleTaxonomyFacet(java.lang.String id,
java.lang.String title,
java.lang.String rootHeadingTitle)
- Construct Taxonomy with a dummy root Heading -- not recommended.
Consumers have more control over the root Heading if they use one
of the other constructors.
SimpleTaxonomyFacet
public SimpleTaxonomyFacet(java.lang.String id,
java.lang.String title,
SimpleTaxonomyHeading root)
getHeadingCount
public int getHeadingCount()
addHeading
public void addHeading(SimpleTaxonomyHeading heading)
- In a TaxonomyFacet, it's clearer to add Headings with
appendHeadingInto(SimpleTaxonomyHeading, SimpleTaxonomyHeading)
since it indicates where the Heading is found in the taxonomy.
If you do use addHeading, this Facet will place the specified Heading
directly below the root Heading (i.e. the specified heading will be included
in getRootHeading().getForwardHeadings() ).
insertHeadingInto
public void insertHeadingInto(SimpleTaxonomyHeading child,
SimpleTaxonomyHeading parent,
int indexWithinParent)
throws java.lang.IllegalArgumentException
- A special subclass method that accommodates the index. This is
the preferred method for adding headings to taxonomies.
- Throws:
java.lang.IllegalArgumentException - if you break the tree model
appendHeadingInto
public void appendHeadingInto(SimpleTaxonomyHeading child,
SimpleTaxonomyHeading parent)
throws java.lang.IllegalArgumentException
- Convenience method to insert a heading into a parent heading, in a
position after all existing children.
- Throws:
java.lang.IllegalArgumentException
getHeading
public Heading getHeading(java.lang.String name)
throws UnknownReferenceException
- Description copied from interface:
Facet
- Retrieves the Heading, with the specified ID, that is contained
by this Facet. If the facet doesn't recognize the ID, it will
throw UnknownReferenceException.
- Specified by:
getHeading in interface Facet- Overrides:
getHeading in class SimpleFacet
- Throws:
UnknownReferenceException
getTaxonomyHeading
public TaxonomyHeading getTaxonomyHeading(java.lang.String name)
throws UnknownReferenceException
- Specified by:
getTaxonomyHeading in interface TaxonomyFacet
- Throws:
UnknownReferenceException
getSimpleTaxonomyHeading
public SimpleTaxonomyHeading getSimpleTaxonomyHeading(java.lang.String name)
throws UnknownReferenceException
- Throws:
UnknownReferenceException
size
public int size()