gov.nih.nlm.umls.meta
Interface Context

All Superinterfaces:
AtomElement, Comparable, ConceptElement, ContentViewElement, SourceElement
All Known Implementing Classes:
ContextImpl

public interface Context
extends AtomElement, Comparable, ConceptElement, ContentViewElement, SourceElement

Represents a single "path to the root" of an Atom, including the relevant tree-numbers and the various ancestors, children, and siblings.

Following is a UML Class diagram showing the neighborhood around Context

All data from MRCXT and MRHIER is represented here.

Author:
Brian Carlsen, Deborah Shapiro

Nested Class Summary
 
Nested classes inherited from class gov.nih.nlm.umls.meta.AtomElement
AtomElement.ByLanguageRestrictor, AtomElement.BySourceRestrictor
 
Nested classes inherited from class gov.nih.nlm.umls.meta.SourceElement
SourceElement.BySourceComparator, SourceElement.BySourceRestrictor
 
Method Summary
 void addContextMember(ContextMember cm)
          Adds the specified ContextMember.
 void clearContextMembers()
          Removes all ContextMembers.
 AdditionalRelationshipLabel getAdditionalRelationshipLabel()
          Returns the AdditionalRelationshipLabel (RELA) from the context member to its parent.
 ContextMember[] getAncestorMembers()
          Returns only the ContextMembers that have the context member label (CXL) of "ANC" or self.
 List getAncestorMembersAsList()
          Returns only the ContextMembers that have the context member label (CXL) of "ANC" or self.
 ContextMember[] getChildMembers()
          Returns only the ContextMembers that have the context member label (CXL) of "CHD" or child.
 List getChildMembersAsList()
          Returns only the ContextMembers that have the context member label (CXL) of "CHD" or child.
 ContextMember[] getContextMembers()
          Returns all ContextMembers.
 List getContextMembersAsList()
          Returns all ContextMembers as a List.
 int getContextNumber()
          Returns the context number (CXN).
 int getCxn()
          Returns the context number (CXN).
 String getHcd()
          Returns the hierarchical code (HCD).
 String getHierarchicalCode()
          Returns the hierarchical code (HCD).
 String getKeyFields()
          Returns a String key which can be used by equals, compareTo, and hashCode methods.
 String getParentAtomIdentifier()
          Returns the parent atom identifier (PAUI).
 String[] getPathToRoot()
          Returns the path to the root (PTR) as a String[] of AUI values.
 List getPathToRootAsList()
          Returns the path to the root (PTR) as a List of AUI values.
 String getPathToRootAsString()
          Returns the path to the root (PTR) as a "." separated list of AUI values.
 String getPaui()
          Returns the parent atom identifier (PAUI).
 String getPtr()
          Returns the path to the root (PTR) as a "." separated list of AUI values.
 AdditionalRelationshipLabel getRela()
          Returns the AdditionalRelationshipLabel (RELA) from the context member to its parent.
 ContextMember getSelfMember()
          Returns the ContextMember that has the context member label (CXL) of "CCP" or self.
 ContextMember[] getSiblingMembers()
          Returns only the ContextMembers that have the context member label (CXL) of "SIB" or self.
 List getSiblingMembersAsList()
          Returns only the ContextMembers that have the context member label (CXL) of "SIB" or self.
 boolean isTopLevel()
          Indicates if context is of the top level.
 void removeContextMember(ContextMember cm)
          Removes the specified ContextMember.
 void setAdditionalRelationshipLabel(AdditionalRelationshipLabel rela)
          Sets the AdditionalRelationshipLabel (RELA) from the context member to its parent.
 void setContextMembers(ContextMember[] cms)
          Replaces the ContextMembers with the ones in the specified array.
 void setContextMembers(List cms)
          Replaces the ContextMembers with the ones in the specified List.
 void setContextNumber(int cxn)
          Sets the context number (CXN).
 void setCxn(int cxn)
          Sets the context number (CXN).
 void setHcd(String hcd)
          Sets the hierarchical code (HCD).
 void setHierarchicalCode(String hcd)
          Sets the hierarchical code (HCD).
 void setParentAtomIdentifier(String paui)
          Sets the parent atom identifier (PAUI).
 void setPathToRoot(String ptr)
          Sets the path to the root (PTR) as a "." separated list of AUI values.
 void setPaui(String paui)
          Sets the parent atom identifier (PAUI).
 void setPtr(String ptr)
          Sets the path to the root (PTR) as a "." separated list of AUI values.
 void setRela(AdditionalRelationshipLabel rela)
          Sets the AdditionalRelationshipLabel (RELA) from the context member to its parent.
 
Methods inherited from interface gov.nih.nlm.umls.meta.AtomElement
getAtom, setAtom
 
Methods inherited from interface java.lang.Comparable
compareTo
 
Methods inherited from interface gov.nih.nlm.umls.meta.ConceptElement
getConcept, setConcept
 
Methods inherited from interface gov.nih.nlm.umls.meta.ContentViewElement
getContentView, getCvf, setContentView, setCvf
 
Methods inherited from interface gov.nih.nlm.umls.meta.SourceElement
getSource, setSource
 

Method Detail

getContextNumber

public int getContextNumber()
Returns the context number (CXN).

Returns:
the int context number

setContextNumber

public void setContextNumber(int cxn)
Sets the context number (CXN).

Parameters:
cxn - the int context number

getCxn

public int getCxn()
Returns the context number (CXN). This is a shorthand for getContextNumber()

Returns:
cxn context number int

setCxn

public void setCxn(int cxn)
Sets the context number (CXN). This is shorthand for setContextNumber(int).

Parameters:
cxn - int context number

getPaui

public String getPaui()
Returns the parent atom identifier (PAUI). This is shorthand for getParentAtomIdentifier().

Returns:
the PAUI

setPaui

public void setPaui(String paui)
Sets the parent atom identifier (PAUI). This is shorthand for setParentAtomIdentifier(String).

Parameters:
paui - the PAUI

getParentAtomIdentifier

public String getParentAtomIdentifier()
Returns the parent atom identifier (PAUI).

Returns:
the PAUI

setParentAtomIdentifier

public void setParentAtomIdentifier(String paui)
Sets the parent atom identifier (PAUI).

Parameters:
paui - the PAUI

getPathToRootAsString

public String getPathToRootAsString()
Returns the path to the root (PTR) as a "." separated list of AUI values.

Returns:
the path to the root

getPathToRootAsList

public List getPathToRootAsList()
Returns the path to the root (PTR) as a List of AUI values.

Returns:
the path to the root as a List of AUI values

getPathToRoot

public String[] getPathToRoot()
Returns the path to the root (PTR) as a String[] of AUI values.

Returns:
the path to the root as a String[] of AUI values

getPtr

public String getPtr()
Returns the path to the root (PTR) as a "." separated list of AUI values. This is shorthand for getPathToRootAsString().

Returns:
the path to the root

setPathToRoot

public void setPathToRoot(String ptr)
Sets the path to the root (PTR) as a "." separated list of AUI values.

Parameters:
ptr - the path to the root

setPtr

public void setPtr(String ptr)
Sets the path to the root (PTR) as a "." separated list of AUI values. This is shorthand for setPathToRoot(String).

Parameters:
ptr - the path to the root

getContextMembers

public ContextMember[] getContextMembers()
Returns all ContextMembers. These are the ancestors, children, and siblings.

Returns:
a sorted array of ContextMembers

getContextMembersAsList

public List getContextMembersAsList()
Returns all ContextMembers as a List. These are the ancestors, children, and siblings.

Returns:
a sorted List of ContextMembers

addContextMember

public void addContextMember(ContextMember cm)
Adds the specified ContextMember.

Parameters:
cm - the ContextMember to be added

removeContextMember

public void removeContextMember(ContextMember cm)
Removes the specified ContextMember.

Parameters:
cm - the ContextMember to be removed

clearContextMembers

public void clearContextMembers()
Removes all ContextMembers.


setContextMembers

public void setContextMembers(ContextMember[] cms)
Replaces the ContextMembers with the ones in the specified array.

Parameters:
cms - a ContextMember[]

setContextMembers

public void setContextMembers(List cms)
Replaces the ContextMembers with the ones in the specified List.

Parameters:
cms - a List of ContextMembers

getHierarchicalCode

public String getHierarchicalCode()
Returns the hierarchical code (HCD).

Returns:
the hierarchical code

getHcd

public String getHcd()
Returns the hierarchical code (HCD). This is shorthand for getHierarchicalCode().

Returns:
the hierarchical code

setHierarchicalCode

public void setHierarchicalCode(String hcd)
Sets the hierarchical code (HCD).

Parameters:
hcd - the hierarchical code

setHcd

public void setHcd(String hcd)
Sets the hierarchical code (HCD). This is shorthand for setHierarchicalCode(String).

Parameters:
hcd - the hierarchical code

getAdditionalRelationshipLabel

public AdditionalRelationshipLabel getAdditionalRelationshipLabel()
Returns the AdditionalRelationshipLabel (RELA) from the context member to its parent.

Returns:
the AdditionalRelationshipLabel

getRela

public AdditionalRelationshipLabel getRela()
Returns the AdditionalRelationshipLabel (RELA) from the context member to its parent. This is shorthand for getAdditionalRelationshipLabel().

Returns:
the AdditionalRelationshipLabel

setAdditionalRelationshipLabel

public void setAdditionalRelationshipLabel(AdditionalRelationshipLabel rela)
Sets the AdditionalRelationshipLabel (RELA) from the context member to its parent.

Parameters:
rela - the AdditionalRelationshipLabel

setRela

public void setRela(AdditionalRelationshipLabel rela)
Sets the AdditionalRelationshipLabel (RELA) from the context member to its parent. This is shorthand for setAdditionalRelationshipLabel(AdditionalRelationshipLabel).

Parameters:
rela - the AdditionalRelationshipLabel

getSelfMember

public ContextMember getSelfMember()
Returns the ContextMember that has the context member label (CXL) of "CCP" or self.

Returns:
ContextMember with label "CCP"

getChildMembers

public ContextMember[] getChildMembers()
Returns only the ContextMembers that have the context member label (CXL) of "CHD" or child.

Returns:
ContextMember[] of members with label "CHD"

getChildMembersAsList

public List getChildMembersAsList()
Returns only the ContextMembers that have the context member label (CXL) of "CHD" or child.

Returns:
ContextMember[] of members with label "CHD"

getAncestorMembers

public ContextMember[] getAncestorMembers()
Returns only the ContextMembers that have the context member label (CXL) of "ANC" or self.

Returns:
ContextMember[] of members with label "ANC"

getAncestorMembersAsList

public List getAncestorMembersAsList()
Returns only the ContextMembers that have the context member label (CXL) of "ANC" or self.

Returns:
ContextMember[] of members with label "ANC"

getSiblingMembers

public ContextMember[] getSiblingMembers()
Returns only the ContextMembers that have the context member label (CXL) of "SIB" or self.

Returns:
ContextMember[] of members with label "SIB"

getSiblingMembersAsList

public List getSiblingMembersAsList()
Returns only the ContextMembers that have the context member label (CXL) of "SIB" or self.

Returns:
ContextMember[] of members with label "SIB"

isTopLevel

public boolean isTopLevel()
Indicates if context is of the top level.

Returns:
boolean true if top level false if otherwise

getKeyFields

public String getKeyFields()
Returns a String key which can be used by equals, compareTo, and hashCode methods.

Returns:
a String composed from key Context fields


Copyright ©2005