gov.nih.nlm.mms
Class Dependency

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

public class Dependency
extends Object
implements Comparable

Represents a dependency between two sources. Used to connect sources together logically to assist in subsetting.

Author:
Deborah Shapiro, Brian Carlsen

Constructor Summary
Dependency()
          Instantiates an empty Dependency.
Dependency(Source source, Source dep_source)
          Instantiates a Dependency between the two specified Sources.
 
Method Summary
 int compareTo(Object o)
          Compares this Dependency to another one.
 boolean equals(Object o)
          Returns true if the specified object is equal to this object.
 Source getDependentSource()
          Returns the dependent Source.
 Source getSource()
          Returns the Source object being depended upon.
 int hashCode()
          Return a hash code based on the source abbreviations.
 void setDependentSource(Source dep_source)
          Sets the dependent Source.
 void setSource(Source source)
          Sets the Source being depended upon.
 String toString()
          Returns a String representation of the dependency.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Dependency

public Dependency()
Instantiates an empty Dependency.


Dependency

public Dependency(Source source,
                  Source dep_source)
Instantiates a Dependency between the two specified Sources.

Parameters:
source - a Source
dep_source - the dependent Source
Method Detail

hashCode

public int hashCode()
Return a hash code based on the source abbreviations.

Returns:
a hash code based on the source abbreviations

equals

public boolean equals(Object o)
Returns true if the specified object is equal to this object. The specified object must be a Dependency 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 Dependency 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

toString

public String toString()
Returns a String representation of the dependency.

Returns:
a String representation of the dependency

getSource

public Source getSource()
Returns the Source object being depended upon.

Returns:
the Source object being depended upon.

setSource

public void setSource(Source source)
Sets the Source being depended upon.

Parameters:
source - the Source being depended upon.

getDependentSource

public Source getDependentSource()
Returns the dependent Source.

Returns:
the dependent Source

setDependentSource

public void setDependentSource(Source dep_source)
Sets the dependent Source.

Parameters:
dep_source - the dependent Source


Copyright ©2005