Package org.biojavax

Class SimpleCrossRef

    • Constructor Detail

      • SimpleCrossRef

        public SimpleCrossRef​(java.lang.String dbname,
                              java.lang.String accession,
                              int version)
        Creates a new instance of SimpleCrossRef with the values to use for the immutable database name, accession and version.
        Parameters:
        dbname - the dbname for this crossref.
        accession - the accession for this crossref.
        version - the version for this crossref.
      • SimpleCrossRef

        public SimpleCrossRef​(java.lang.String dbname,
                              java.lang.String accession,
                              java.lang.Integer version)
        Creates a new instance of SimpleCrossRef with the values to use for the immutable database name, accession and version. Identical to other dbname/accession/version constructor except the version is specified as an Integer object rather than an int primitive. Will throw an exception if version is null.
        Parameters:
        dbname - the dbname for this crossref.
        accession - the accession for this crossref.
        version - the version for this crossref.
      • SimpleCrossRef

        protected SimpleCrossRef()
    • Method Detail

      • getAnnotation

        public Annotation getAnnotation()
        Should return the associated annotation object.
        Specified by:
        getAnnotation in interface Annotatable
        Returns:
        an Annotation object, never null
      • getNoteSet

        public java.util.Set getNoteSet()
        Returns the set of notes associated with this object. Would normally delegate call to internal RichAnnotation instance.
        Specified by:
        getNoteSet in interface RichAnnotatable
        Returns:
        set a set of Note objects.
        See Also:
        Note
      • setNoteSet

        public void setNoteSet​(java.util.Set notes)
        Clears the notes associated with this object and replaces them with the contents of this set. Would normally delegate call to internal RichAnnotation instance.
        Specified by:
        setNoteSet in interface RichAnnotatable
        Parameters:
        notes - the set of Note objects to replace the existing ones with.
        See Also:
        Note
      • getAccession

        public java.lang.String getAccession()
        Returns the accession of the object that the crossref refers to.
        Specified by:
        getAccession in interface CrossRef
        Returns:
        Value of property accession.
      • getDbname

        public java.lang.String getDbname()
        Returns the name of the database the cross reference refers to. This would normally be a namespace name, eg. 'gb' for GenBank.
        Specified by:
        getDbname in interface CrossRef
        Returns:
        Value of property dbname.
      • getVersion

        public int getVersion()
        Returns the version of the object that the crossref refers to.
        Specified by:
        getVersion in interface CrossRef
        Returns:
        Value of property version.
      • compareTo

        public int compareTo​(java.lang.Object o)
        Compares cross references first by database name, then by accession, then by version.
        Specified by:
        compareTo in interface java.lang.Comparable
      • equals

        public boolean equals​(java.lang.Object obj)
        Equality is defined as having the same database name, accession and version.
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        Form: "dbname:accession.version"
        Overrides:
        toString in class java.lang.Object
      • getId

        public java.lang.Integer getId()
        Gets the Hibernate ID. Should be used with caution.
        Returns:
        the Hibernate ID, if using Hibernate.
      • setId

        public void setId​(java.lang.Integer id)
        Sets the Hibernate ID. Should be used with caution.
        Parameters:
        id - the Hibernate ID, if using Hibernate.