gov.nih.nlm.mms.filters
Class AttType

java.lang.Object
  extended bygov.nih.nlm.mms.filters.AttType
All Implemented Interfaces:
Comparable

public class AttType
extends Object
implements Comparable

Class contains all fields relevant to an attribute type

Author:
Deborah Shapiro, Brian Carlsen

Constructor Summary
AttType()
          This is the default no-argument constructor
AttType(Source source, String type)
          This constructor takes initial values for each of the fields in the AttType.
AttType(String line)
          This constructor takes a String in the form sab|type .
AttType(String sab, String type)
          This constructor takes initial values for each of the fields in the AttType.
 
Method Summary
 int compareTo(Object o)
          This method compares this AttType with a parameter Object based on the source abbreviation.
 boolean equals(Object o)
          This method returns true if the parameter has a source abbreviation and a attribute type that have the same values as those in this AttType.
 Source getSource()
          This method returns the name of the source.
 String getType()
          This method returns the attribute type.
 int hashCode()
          Get hashcode based on source abbreviation and attribute type.
 void setSource(Source source)
          This method sets the Source value of the attribute type.
 void setType(String type)
          This method sets the value of the attribute type.
 String toString()
          Get a string representation of the AttType that includes the two fields that make the AttType unique.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AttType

public AttType()
This is the default no-argument constructor


AttType

public AttType(String line)
This constructor takes a String in the form sab|type .

Parameters:
line - String containing all fields needed for a AttType

AttType

public AttType(String sab,
               String type)
This constructor takes initial values for each of the fields in the AttType.

Parameters:
sab - String An initial value for the source abbreviation
type - String

AttType

public AttType(Source source,
               String type)
This constructor takes initial values for each of the fields in the AttType.

Parameters:
source - Source
type - String
Method Detail

hashCode

public int hashCode()
Get hashcode based on source abbreviation and attribute type.

Returns:
int hash code for this AttType

equals

public boolean equals(Object o)
This method returns true if the parameter has a source abbreviation and a attribute type that have the same values as those in this AttType.

Parameters:
o - Object to be compared with this AttType
Returns:
boolean true if parameter o equals AttType false if parameter o is not equal to AttType

compareTo

public int compareTo(Object o)
This method compares this AttType with a parameter Object based on the source abbreviation.

Specified by:
compareTo in interface Comparable
Parameters:
o - Object to be compared with this AttType
Returns:
int 0 if the parameter is not a AttType

toString

public String toString()
Get a string representation of the AttType that includes the two fields that make the AttType unique.

Returns:
String representation of the AttType

getSource

public Source getSource()
This method returns the name of the source.

Returns:
Source

setSource

public void setSource(Source source)
This method sets the Source value of the attribute type.

Parameters:
source - Source

getType

public String getType()
This method returns the attribute type.

Returns:
String

setType

public void setType(String type)
This method sets the value of the attribute type.

Parameters:
type - value for the attribute type


Copyright ©2005