org.ceryle.xtm
Class XtmAssociation

java.lang.Object
  extended by org.ceryle.xtm.XtmNode
      extended by org.ceryle.xtm.XtmAssociation
All Implemented Interfaces:
Iterator, Constants

public class XtmAssociation
extends XtmNode

Defines a topic association, such that instances of this class are objects containing the features of XTM associations, designed to assist in building in-memory representations via the XtmProcessor class. XtmAssociation objects do not represent XTM <association> Elements.

Since:
JDK1.3
Version:
$Id: XtmAssociation.java,v 3.3 2007-06-15 12:10:34 altheim Exp $
Author:
Murray Altheim

Field Summary
 
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
 
Fields inherited from interface org.ceryle.util.Constants
Amp, AMP, Apos, APOS, APP_NAME, APP_VERSION_NAME, APP_VERSION_NUMBER, AT, BANG, BAR, BIT_dev, BIT_http, BIT_ignoreCom, BIT_merge, BIT_none, BIT_noPreload, BIT_simple, BIT_ui, BIT_unused1, BIT_unused2, BIT_unused3, BIT_validating, BIT_verbose, BIT_xcatalog, BIT_xlink, BIT_xmlnsAware, BIT_xsd, BROKB, BSlash, BSLASH, CERYLE_CREDITS_FILE, CERYLE_DATA_DIR, CERYLE_HIST_FILE, CERYLE_LICENSE_FILE, CERYLE_PREF_FILE, CERYLE_PROP, CERYLE_PROP_BASE, CERYLE_PROP_FILE, CERYLE_RSRC_DIR, CERYLE_THANKS_FILE, CFLEX, Colon, COLON, Comma, COMMA, CR, CRet, Dash, DASH, DEFAULT_DIRECTORY, DEVELOPER, DOLR, Dot, DOT, EIGHT, Ellip, EOF, EqQuot, EQUAL, Equals, False, FALSE, FileProt, Filesep, FileURL, Five, FIVE, FONTSIZES, Four, FOUR, FSchar, GCOL_PROP, GRAPH_PROP, GRAVE, GT, Hash, HASH, HOME_DIRECTORY, HOME_DIRECTORY_PATH, HOME_DIRECTORY_URL, HTML, HttpProt, HttpURL, INDENT, INDENT_0, INDENT_1, INDENT_10, INDENT_2, INDENT_3, INDENT_4, INDENT_5, INDENT_6, INDENT_7, INDENT_8, INDENT_9, INIT, LCURL, LCurly, LF, LFS, Localhost, LPAR, LParen, LS, LSBrkt, LSBrkt2, LSQB, LT, MT, NBSP, NEL, NINE, NL, NL20x, NLchar, No, Null, NULL, NULL_STATE, NumParams, One, ONE, Pathsep, Percent, PERO, PLUS, Prcnt, PS, QMark, QMARK, Quot, QUOT, RCURL, RCurly, RESOURCE_BUNDLE, RPAR, RParen, RSBrkt, RSBrkt2, RSQB, Semi, SEMI, SEVEN, SIX, Slash, SLASH, SP, SPACE, Stago, Star, STAR, Tab, TAB, Tee, Three, THREE, Tilde, TILDE, TM_PROP, True, TRUE, Two, TWO, Under, UNDER, URI, URL, VBar, WIKI_PROP, XNodePfx, XNodeURL, XtmExt, Yes, Zero, ZERO
 
Constructor Summary
XtmAssociation()
          XtmAssociation constructor.
XtmAssociation(String id)
          XtmAssociation constructor with ID.
XtmAssociation(String id, XtmReference xref)
          XtmAssociation constructor with ID and an XtmReference xref, serving as the type of this association.
 
Method Summary
 void addMember(XtmMember member)
          Add an XtmMember member to the members of this XtmAssociation.
 void addScope(XtmReference xref)
          Add an XtmReference xref as a scope of this XtmAssociation.
 void addScope(XtmScope scope)
          Add the XtmReference objects of the supplied XtmScope scope as the scope of this XtmAssociation.
 String getHash()
          Returns a String that identifies this XtmAssociation by all of its characteristics.
 int getMemberCount()
          Returns the number of XtmMember objects of this XtmAssociation.
 Iterator getMembers()
          Returns an iterator of XtmMember objects each indicating a member of this XtmAssociation, or null if none have exist.
 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.
 XtmScope getScope()
          Returns the XtmScope object indicating the scope of this XtmAssociation.
 XtmReference getType()
          Returns the XtmReference indicating a type to which this XtmAssociation belongs, or null if this has not been set.
 void setType(XtmReference xref)
          Sets the XtmReference xref as the type to which this XtmAssociation belongs.
 
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
 

Constructor Detail

XtmAssociation

public XtmAssociation()
               throws XtmException
XtmAssociation constructor.

Throws:
XtmException

XtmAssociation

public XtmAssociation(String id)
               throws XtmException
XtmAssociation constructor with ID.

Throws:
XtmException

XtmAssociation

public XtmAssociation(String id,
                      XtmReference xref)
               throws XtmException
XtmAssociation constructor with ID and an XtmReference xref, serving as the type of this association.

Throws:
XtmException
Method Detail

getName

public String getName()
Returns a String containing the name of this XTM element type.

Overrides:
getName in class XtmNode

getNodeType

public short getNodeType()
A short integer indicating what type of node this is. The named constants for this value are defined in the org.ceryle.XtmNode class.

Overrides:
getNodeType in class XtmNode

setType

public void setType(XtmReference xref)
             throws XtmException
Sets the XtmReference xref as the type to which this XtmAssociation belongs. The type shows up in XML syntax as the content of an <instanceOf> Element.

Parameters:
xref - the XtmReference serving as the type of this XtmAssociation.
Throws:
XtmException - if type has already been set.

getType

public XtmReference getType()
Returns the XtmReference indicating a type to which this XtmAssociation belongs, or null if this has not been set. Each type shows up in XML syntax as the content of an <instanceOf> Element. If this XtmTopic might belong to more than one type, use getTypes().


addScope

public void addScope(XtmReference xref)
              throws XtmException
Add an XtmReference xref as a scope of this XtmAssociation.

Throws:
XtmException

addScope

public void addScope(XtmScope scope)
              throws XtmException
Add the XtmReference objects of the supplied XtmScope scope as the scope of this XtmAssociation.

Throws:
XtmException

getScope

public XtmScope getScope()
Returns the XtmScope object indicating the scope of this XtmAssociation.


addMember

public void addMember(XtmMember member)
Add an XtmMember member to the members of this XtmAssociation.


getMemberCount

public int getMemberCount()
Returns the number of XtmMember objects of this XtmAssociation.


getMembers

public Iterator getMembers()
Returns an iterator of XtmMember objects each indicating a member of this XtmAssociation, or null if none have exist.


getHash

public String getHash()
Returns a String that identifies this XtmAssociation by all of its characteristics. Two XtmAssociations having the same characteristics (as according to Annex F.2.4 of XTM 1.0) will have the same hash value.



The Ceryle Project. Copyright ©2001-2007 Murray Altheim, All Rights Reserved. See LICENSE included with distribution.