|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.ceryle.xtm.XtmNode
org.ceryle.xtm.XtmTopic
public class XtmTopic
Defines a topic object, as in a topic map, such that instances of this class are objects containing the features of XTM topics, designed to assist in building in-memory representations via the XtmProcessor class. XtmTopics are not representations of XTM <topic> Elements.
| Field Summary | |
|---|---|
protected TreeSet |
baseNames
The TreeSet containing any scoped base names (as XtmBaseName objects) of this XtmTopic. |
protected XtmOccurrence |
description
The XtmOccurrence acting as a textual description of this XtmTopic. |
protected TreeSet |
occurrences
The TreeSet containing XtmOccurrence objects indicating the occurrences of this XtmTopic. |
protected TreeSet |
subjectIdentity
The TreeSet containing XtmReference objects indicating the subjectIdentity of this XtmTopic. |
protected TreeSet |
types
The TreeSet containing XtmReference objects indicating the type of this XtmTopic; this shows up in XML syntax as the content of an <instanceOf> element. |
| Fields inherited from class org.ceryle.xtm.XtmNode |
|---|
ASSOCIATION_NODE, BASENAME_NODE, BASENAMESTRING_NODE, COMMENT_NODE, DOCUMENT_NODE, GrpSep, GRPSEP, id, INSTANCEOF_NODE, MEMBER_NODE, MERGEMAP_NODE, NODE, NonType, NONTYPE, OCCURRENCE_NODE, PARAMETERS_NODE, PROCESSING_INSTRUCTION_NODE, RecSep, RECSEP, REFERENCE_NODE, RESOURCEDATA_NODE, RESOURCEREF_NODE, ROLESPEC_NODE, SCOPE_NODE, SUBJECTIDENTITY_NODE, SUBJECTINDICATORREF_NODE, TOPIC_NODE, TOPICMAP_NODE, TOPICREF_NODE, VARIANT_NODE, VARIANTNAME_NODE |
| Constructor Summary | |
|---|---|
XtmTopic(String id)
XtmTopic constructor with a required ID String id. |
|
XtmTopic(String id,
XtmReference xref)
XtmTopic constructor with a required ID String id and an XtmReference topic type xref (see setType(XtmReference)). |
|
| Method Summary | |
|---|---|
XtmBaseName |
addBaseName(XtmBaseName baseName)
Add an XtmBaseName name to this XtmTopic, returning
the provided XtmBaseName. |
void |
addDescription(String id,
String text)
Add a textual description of this XtmTopic as an XtmOccurrence occurrence whose type is the PSI
http://purl.org/ceryle/psi/ceryle/#Description, with a required
ID value id. |
void |
addOccurrence(XtmOccurrence occurrence)
Add an XtmOccurrence occurrence to this XtmTopic. |
void |
addSubjectIdentity(XtmReference xref)
Add an XtmReference xref to the subject identity of this XtmTopic. |
int |
compareTo(Object o)
Compares the ID of this XtmTopic with the provided Object for order. |
Iterator |
getBaseNames()
Returns an Iterator over a collection of XtmBaseNames, or null if none have been defined. |
XtmOccurrence |
getDescription()
Returns a textual description of this XtmTopic as an XtmOccurrence, null if this hasn't been set (the topic description is indicated by a PSI). |
TreeSet |
getHashes()
Returns a TreeSet containing a collection of Strings, each representing a scoped base name string using XtmBaseName.getHash(). |
static String |
getLabel(XtmTopic topic)
Returns this XtmTopic's display name (label) from one of its base names. |
String |
getName()
Returns a String containing the name of this XTM element type. |
short |
getNodeType()
A short integer indicating what type of node this is. |
int |
getOccurrenceCount(boolean ignoreDescription)
Returns the number of XtmOccurrences. |
Iterator |
getOccurrences()
Returns an Iterator over a collection of XtmOccurrences, or null if none have been defined. |
Iterator |
getSubjectIdentity()
Returns an Iterator over a collection of XtmReferences, or null if none have been defined. |
XtmReference |
getType()
Returns the XtmReference indicating a type to which this XtmTopic belongs, or null if this has not been set. |
Iterator |
getTypes()
Returns an iterator of XtmReference objects each indicating a type to which this XtmTopic belongs, or null if none have been set. |
boolean |
matchesClass(String uri)
Returns true if this XtmTopic is an instance of the class (or "type") ascertained by a String match with the URI reference uri. |
boolean |
matchesClass(XtmReference xref)
Returns true if this XtmTopic is an instance of the class (or "type") ascertained by (a) an identify match of any of the XtmNode's types with the provided XtmReference, or (b) a String match with the URI reference of the XtmReference xref. |
boolean |
removeBaseName(XtmBaseName baseName)
Remove the XtmBaseName basename from this XtmTopic, returning
true if the provided XtmBaseName was actually attached to this XtmTopic. |
boolean |
removeOccurrence(XtmOccurrence occurrence)
Remove the XtmOccurrence occurrence from this XtmTopic,
returning true if this occurred. |
void |
setDescription(String id,
String text)
Sets the textual description of this XtmTopic as an XtmOccurrence occurrence whose type is the PSI
http://purl.org/ceryle/psi/ceryle/#Description, with a required
ID value id. |
void |
setLabel(String label)
Sets a label for this XtmTopic to the string label. |
void |
setType(XtmReference xref)
Adds the type indicated by the XtmReference xref to this XtmTopic. |
void |
setType(XtmReference xref,
boolean replace)
Adds the type indicated by the XtmReference xref to this XtmTopic. |
void |
setTypes(Collection xrefs)
Adds the types indicated by the XtmReferences xrefs to this XtmTopic. |
| Methods inherited from class org.ceryle.xtm.XtmNode |
|---|
addPI, getID, getPI, getPIs, hasNext, next, remove, removePI, setID |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected TreeSet types
protected TreeSet subjectIdentity
protected TreeSet baseNames
protected TreeSet occurrences
protected XtmOccurrence description
| Constructor Detail |
|---|
public XtmTopic(String id)
throws XtmException
XtmException
public XtmTopic(String id,
XtmReference xref)
throws XtmException
setType(XtmReference)).
XtmException| Method Detail |
|---|
public String getName()
getName in class XtmNodepublic short getNodeType()
getNodeType in class XtmNode
public void setType(XtmReference xref)
throws XtmException
xref to this XtmTopic.
A convenience method whose default is to replace any existing type, which exists
so that all setType() methods in the package have the same, single parameter.
XtmException
public void setType(XtmReference xref,
boolean replace)
throws XtmException
xref to this XtmTopic.
Each type shows up in XML syntax as the content of an <instanceOf> Element.
If the boolean replace is true, the new type will replace any existing type(s).
XtmException
public void setTypes(Collection xrefs)
throws XtmException
xrefs to this XtmTopic.
Each type shows up in XML syntax as the content of an <instanceOf>
Element. A topic may be an instance of more than one type.
XtmExceptionpublic XtmReference getType()
public Iterator getTypes()
public boolean matchesClass(XtmReference xref)
public boolean matchesClass(String uri)
public TreeSet getHashes()
XtmBaseName.getHash().
public Iterator getBaseNames()
public static String getLabel(XtmTopic topic)
public void setLabel(String label)
throws XtmException
NOTE: This first locates any existing base names having a "display" variant name, eliminates those base names, and sets this as the only one. This is necessarily ignoring scoping on the base name itself.
XtmExceptionpublic XtmBaseName addBaseName(XtmBaseName baseName)
name to this XtmTopic, returning
the provided XtmBaseName.
public boolean removeBaseName(XtmBaseName baseName)
basename from this XtmTopic, returning
true if the provided XtmBaseName was actually attached to this XtmTopic.
public Iterator getSubjectIdentity()
public void addSubjectIdentity(XtmReference xref)
xref to the subject identity of this XtmTopic.
public void addOccurrence(XtmOccurrence occurrence)
occurrence to this XtmTopic.
public boolean removeOccurrence(XtmOccurrence occurrence)
occurrence from this XtmTopic,
returning true if this occurred.
public int getOccurrenceCount(boolean ignoreDescription)
public Iterator getOccurrences()
public void addDescription(String id,
String text)
throws XtmException
occurrence whose type is the PSI
http://purl.org/ceryle/psi/ceryle/#Description, with a required
ID value id. This will overwrite the reference to any
previous description (though its XtmOccurrence remains in the
Vector of occurrences).
XtmException
public void setDescription(String id,
String text)
throws XtmException
occurrence whose type is the PSI
http://purl.org/ceryle/psi/ceryle/#Description, with a required
ID value id. Unlike addDescription(), this replaces
any previous XtmOccurrence used as a description. Any references to
the previous description's resource ID may then be invalid. If
either id or text is null, removes any existing
description.
XtmExceptionpublic XtmOccurrence getDescription()
public int compareTo(Object o)
compareTo in interface Comparable
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||