| java.lang.Object com.sun.portal.search.rdm.RDMTaxonomy
RDMTaxonomy | public class RDMTaxonomy (Code) | | RDM Taxonomy
Represents a hierarchy of Classifications (or Categories).
The Taxonomy supports basic lookup and enumeration primitives
for understanding the organization and content of the Classifications.
To load a Taxonomy definition encoded in SOIF from a file or memory,
use RDMTaxonomy_Parse().
Example:
SOIFStream *ss = SOIF_ParseInitFile(stdin);
t = RDMTaxonomy_Parse(ss);
To create a Taxonomy structure with no Classifications,
use RDMTaxonomy_Create().
To free an entire Taxonomy and all of its Classifications,
use RDMTaxonomy_Free().
|
Method Summary | |
public void | apply(int order, RDMCallback cb) To traverse the Taxonomy in the given order, use apply()
and give an explicit traversal policy:
RDM_TAX_INORDER - node, then children (recommended)
RDM_TAX_PREORDER - same as INORDER
RDM_TAX_POSTORDER - children, then node
Example:
(*t.apply)(t, RDM_TAX_INORDER, MyFn, NULL);
... | protected void | delete(RDMClassification c) | public int | depth(RDMClassification c) | public RDMClassification | find(String cid) To lookup a Classification Id in the taxonomy, use find(). | public String | getDescription() | public String | getId() Macros for accessing @TAXONOMY values
Use prototype: char *RDMTaxonomy_GetXXX(RDMTaxonomy *t). | public String | getLMT() | public String | getMaintainer() | public SOIF | getSOIF() | public void | insert(RDMClassification c) To insert a new classification, use insert().
The given Classification object is inserted into the Taxonomy
structure. | public void | setDescription(String s) | public void | setId(String s) Macros for defining @TAXONOMY values
Use prototype: int RDMTaxonomy_SetXXX(RDMTaxonomy *t, char *newvalue). | public void | setLMT(String s) | public void | setMaintainer(String s) |
RDM_TAXONOMY_ROOT | final public static String RDM_TAXONOMY_ROOT(Code) | | |
RDMTaxonomy | public RDMTaxonomy(SOIFInputStream ss) throws Exception(Code) | | RDMTaxonomy_Parse - Loads a taxonomy definition written in SOIF
from the input SOIFStream. Returns null on error; otherwise,
returns the RDMTaxonomy.
|
apply | public void apply(int order, RDMCallback cb) throws Exception(Code) | | To traverse the Taxonomy in the given order, use apply()
and give an explicit traversal policy:
RDM_TAX_INORDER - node, then children (recommended)
RDM_TAX_PREORDER - same as INORDER
RDM_TAX_POSTORDER - children, then node
Example:
(*t.apply)(t, RDM_TAX_INORDER, MyFn, NULL);
...
void MyFn(RDMClassification *c, void *unused)
{
printf("Classification = %s{n",
RDMClassification_GetId(c));
}
|
find | public RDMClassification find(String cid)(Code) | | To lookup a Classification Id in the taxonomy, use find().
Example:
RDMClassification *musicp = (*t.find)(t, "Arts:Music");
|
getId | public String getId()(Code) | | Macros for accessing @TAXONOMY values
Use prototype: char *RDMTaxonomy_GetXXX(RDMTaxonomy *t).
|
insert | public void insert(RDMClassification c)(Code) | | To insert a new classification, use insert().
The given Classification object is inserted into the Taxonomy
structure. Use delete() to release the classification object
from the Taxonomy.
|
setId | public void setId(String s)(Code) | | Macros for defining @TAXONOMY values
Use prototype: int RDMTaxonomy_SetXXX(RDMTaxonomy *t, char *newvalue).
|
|
|