Revision 423M

org.bridgedb
Class Xref

java.lang.Object
  extended by org.bridgedb.Xref
All Implemented Interfaces:
java.lang.Comparable<Xref>

public class Xref
extends java.lang.Object
implements java.lang.Comparable<Xref>

Stores an id + DataSource combination, which represents an unique gene product.

Immutable class, thread safe


Constructor Summary
Xref(java.lang.String id, DataSource ds)
           
 
Method Summary
 int compareTo(Xref idc)
          Compares two Xrefs, asciibetically using string representation.
 boolean equals(java.lang.Object o)
           
 DataSource getDataSource()
           
 java.lang.String getId()
           
 java.lang.String getUrl()
          Uses DataSource.getUrl() to create a valid URL for an online webpage describing this entity.
 java.lang.String getURN()
          Uses DataSource.getURN() to create a global identifier, such as urn:miriam:uniprot:P12345.
 int hashCode()
          hashCode calculated from id and datasource combined.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Xref

public Xref(java.lang.String id,
            DataSource ds)
Parameters:
id - the Id part of this Xref
ds - the DataSource part of this Xref.
Method Detail

getDataSource

public DataSource getDataSource()
Returns:
the DataSource part of this Xref

getId

public java.lang.String getId()
Returns:
the id part of this Xref

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object
Returns:
short string representation for this Xref, for example En:ENSG000001 or X:1004_at This string representation is not meant to be stored or parsed, it is there mostly for debugging purposes.

hashCode

public int hashCode()
hashCode calculated from id and datasource combined.

Overrides:
hashCode in class java.lang.Object
Returns:
the hashCode

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object
Parameters:
o - Object to compare to
Returns:
true if both the id and the datasource are equal.

compareTo

public int compareTo(Xref idc)
Compares two Xrefs, asciibetically using string representation.

Specified by:
compareTo in interface java.lang.Comparable<Xref>
Parameters:
idc - Xref to compare to
Returns:
0 if equal, positive number if higher, negative number if lower.

getUrl

public java.lang.String getUrl()
Uses DataSource.getUrl() to create a valid URL for an online webpage describing this entity.

Returns:
url as a String.

getURN

public java.lang.String getURN()
Uses DataSource.getURN() to create a global identifier, such as urn:miriam:uniprot:P12345.

Returns:
the URN as string

Generated July 29 2010