gov.nih.nlm.umls.meta.impl
Class AttributeContextImpl

java.lang.Object
  extended bygov.nih.nlm.umls.meta.impl.AttributeContextImpl
All Implemented Interfaces:
AttributeContext, Comparable, SourceElement

public class AttributeContextImpl
extends Object
implements AttributeContext

Default implementation of the AttributeContext interface.

Author:
Brian Carlsen, Deborah Shapiro

Nested Class Summary
 
Nested classes inherited from class gov.nih.nlm.umls.meta.SourceElement
SourceElement.BySourceComparator, SourceElement.BySourceRestrictor
 
Constructor Summary
AttributeContextImpl()
          Instantiates an empty AttributeContext.
AttributeContextImpl(AttributeContext att)
          Instantiates a AttributeContext from the specified AttributeContext.
 
Method Summary
 void addAttributeValue(AttributeValue av)
          Adds the specified AttributeValue.
 void clearAttributeValues()
          Removes all AttributeValues.
 int compareTo(Object o)
          Compares this AttributeContext to another one.
 boolean equals(Object o)
          Returns true if the specified object is equal to this object.
 Atom getAtom()
          Returns the Atom for this AttributeContext.
 AttributeValue[] getAttributeValues()
          Returns all AttributeValues.
 List getAttributeValuesAsList()
          Returns all AttributeValues as a List.
 String getKeyFields()
          Returns a String key which can be used by equals, compareTo, and hashCode methods.
 Source getSource()
          Returns the source for this AttributeContext.
 SourceIdentifierType getSourceIdentifierType()
          Returns the SourceIdentifierType for this AttributeContext.
 StringAttribute getStringAttribute()
          Returns the StringAttribute that holds this AttributeContext.
 int hashCode()
          Return a hash code based on key fields.
 void removeAttributeValue(AttributeValue av)
          Removes the specified AttributeValue.
 void setAtom(Atom string_source)
          Sets the Atom for this AttributeContext.
 void setAttributeValues(AttributeValue[] avs)
          Replaces the AttributeValues with the ones in the specified array.
 void setAttributeValues(List avs)
          Replaces the AttributeValues with the ones in the specified List.
 void setSource(Source source)
          Sets the source for this AttributeContext.
 void setSourceIdentifierType(SourceIdentifierType source_id_type)
          Sets the SourceIdentifierType for this AttributeContext.
 void setStringAttribute(StringAttribute sa)
          Sets the StringAttribute that holds this AttributeContext.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AttributeContextImpl

public AttributeContextImpl()
Instantiates an empty AttributeContext.


AttributeContextImpl

public AttributeContextImpl(AttributeContext att)
Instantiates a AttributeContext from the specified AttributeContext.

Parameters:
att - AttributeContext to be copied
Method Detail

getStringAttribute

public StringAttribute getStringAttribute()
Returns the StringAttribute that holds this AttributeContext.

Specified by:
getStringAttribute in interface AttributeContext
Returns:
the StringAttribute that holds this AttributeContext

setStringAttribute

public void setStringAttribute(StringAttribute sa)
Sets the StringAttribute that holds this AttributeContext.

Specified by:
setStringAttribute in interface AttributeContext
Parameters:
sa - the StringAttribute that holds this AttributeContext

getAtom

public Atom getAtom()
Returns the Atom for this AttributeContext.

Specified by:
getAtom in interface AttributeContext
Returns:
Atom

setAtom

public void setAtom(Atom string_source)
Sets the Atom for this AttributeContext.

Specified by:
setAtom in interface AttributeContext
Parameters:
string_source - Atom

getSourceIdentifierType

public SourceIdentifierType getSourceIdentifierType()
Returns the SourceIdentifierType for this AttributeContext.

Specified by:
getSourceIdentifierType in interface AttributeContext
Returns:
SourceIdentifierType

setSourceIdentifierType

public void setSourceIdentifierType(SourceIdentifierType source_id_type)
Sets the SourceIdentifierType for this AttributeContext.

Specified by:
setSourceIdentifierType in interface AttributeContext
Parameters:
source_id_type - SourceIdentifierType

getSource

public Source getSource()
Returns the source for this AttributeContext.

Specified by:
getSource in interface SourceElement
Returns:
Source

setSource

public void setSource(Source source)
Sets the source for this AttributeContext.

Specified by:
setSource in interface SourceElement
Parameters:
source - Source

getAttributeValues

public AttributeValue[] getAttributeValues()
Returns all AttributeValues.

Specified by:
getAttributeValues in interface AttributeContext
Returns:
a array of AttributeValues

getAttributeValuesAsList

public List getAttributeValuesAsList()
Returns all AttributeValues as a List.

Specified by:
getAttributeValuesAsList in interface AttributeContext
Returns:
a List of AttributeValues

addAttributeValue

public void addAttributeValue(AttributeValue av)
Adds the specified AttributeValue.

Specified by:
addAttributeValue in interface AttributeContext
Parameters:
av - the AttributeValue to be added

removeAttributeValue

public void removeAttributeValue(AttributeValue av)
Removes the specified AttributeValue.

Specified by:
removeAttributeValue in interface AttributeContext
Parameters:
av - the AttributeValue to be removed

clearAttributeValues

public void clearAttributeValues()
Removes all AttributeValues.

Specified by:
clearAttributeValues in interface AttributeContext

setAttributeValues

public void setAttributeValues(AttributeValue[] avs)
Replaces the AttributeValues with the ones in the specified array.

Specified by:
setAttributeValues in interface AttributeContext
Parameters:
avs - a AttributeValue[]

setAttributeValues

public void setAttributeValues(List avs)
Replaces the AttributeValues with the ones in the specified List.

Specified by:
setAttributeValues in interface AttributeContext
Parameters:
avs - a List of AttributeValues

getKeyFields

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

Specified by:
getKeyFields in interface AttributeContext
Returns:
a String composed from aui.

hashCode

public int hashCode()
Return a hash code based on key fields.

Returns:
a hash code based on key fields

equals

public boolean equals(Object o)
Returns true if the specified object is equal to this object. The specified object must be an AttributeContext with matching key fields.

Parameters:
o - an Object to compare against
Returns:
boolean true if Object o is equal false otherwise

compareTo

public int compareTo(Object o)
Compares this AttributeContext to another one. Results are indeterminate if the specified parameter is not of the same class.

Specified by:
compareTo in interface Comparable
Parameters:
o - the Object to compare to
Returns:
int representing the relative ordering of this and the compare-to object


Copyright ©2005