Package org.biojavax

Class SimpleComment

    • Constructor Detail

      • SimpleComment

        public SimpleComment​(String comment,
                             int rank)
        Constructs a new, immutable comment, given some text and a rank.
        Parameters:
        comment - the text of the comment. Cannot be null.
        rank - the rank of the comment.
    • Method Detail

      • getRank

        public int getRank()
        Returns the rank of this comment.
        Specified by:
        getRank in interface Comment
        Returns:
        the rank.
      • equals

        public boolean equals​(Object obj)
        Two comments are defined as equal if their text values and rankings are identical.
        Overrides:
        equals in class Object
      • compareTo

        public int compareTo​(Object o)
        Comments are ordered first by their rank, then by a string comparison of their text values.
        Specified by:
        compareTo in interface Comparable
      • getId

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

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