gov.nih.nlm.mms.filters
Class RelType

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

public class RelType
extends Object
implements Comparable

Class contains all fields relevant to a relationship type.

Author:
Deborah Shapiro, Brian Carlsen

Constructor Summary
RelType()
          This is the default no-argument constructor
RelType(Source source, String type)
          This constructor takes initial values for each of the fields in the RelType.
RelType(String line)
          This constructor takes a String in the form sab|type.
RelType(String sab, String type)
          This constructor takes initial values for each of the fields in the RelType.
 
Method Summary
 int compareTo(Object o)
          This method compares the RelType 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 relationship type that have the same values as those in this RelType.
 Source getSource()
          This method returns the name of the Source in this RelType.
 String getType()
          This method returns the type of the RelType.
 int hashCode()
          Get hashcode based on source abbreviation and relationship type
 void setSource(Source source)
          This method sets the Source of the RelType.
 void setType(String type)
          This method sets the type of the RelType.
 String toString()
          Returns a String representation of the RelType that includes the two fields that make the RelType unique.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RelType

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


RelType

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

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

RelType

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

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

RelType

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

Parameters:
source - Source
type - String
Method Detail

hashCode

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

Returns:
hash code for this RelType

equals

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

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

compareTo

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

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

toString

public String toString()
Returns a String representation of the RelType that includes the two fields that make the RelType unique.

Returns:
String representation of the RelType

getSource

public Source getSource()
This method returns the name of the Source in this RelType.

Returns:
Source

setSource

public void setSource(Source source)
This method sets the Source of the RelType.

Parameters:
source - Source

getType

public String getType()
This method returns the type of the RelType.

Returns:
String representation of the type

setType

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

Parameters:
type - String value for the type


Copyright ©2005