Class SimpleCitation

    • Constructor Detail

      • SimpleCitation

        public SimpleCitation​(String title)
        Creates a new citation having the given title. The given string will be returned, directly or indirectly, by the getTitle(), toString() and toString(Locale) methods.
        Parameters:
        title - the citation title to be returned indirectly by getTitle().
    • Method Detail

      • length

        public int length()
        Returns the number of characters in the title.
        Specified by:
        length in interface CharSequence
        Returns:
        the number of chars in the title.
      • charAt

        public char charAt​(int index)
        Returns the title character at the given index
        Specified by:
        charAt in interface CharSequence
        Parameters:
        index - the index of the char value to be returned.
        Returns:
        the specified char value.
      • subSequence

        public String subSequence​(int start,
                                  int end)
        Returns a substring of the title for the given range of index.
        Specified by:
        subSequence in interface CharSequence
        Parameters:
        start - the start index, inclusive.
        end - the end index, exclusive.
        Returns:
        the specified substring of the title.
      • toString

        public String toString​(Locale locale)
        Returns the title, ignoring the given locale. For localization support, an other class (or a subclass of this SimpleCitation class) is required.
        Specified by:
        toString in interface InternationalString
        Parameters:
        locale - ignored by the SimpleCitation implementation.
        Returns:
        the string given to the constructor, localized if supported by the implementation.
        See Also:
        getTitle()
      • compareTo

        public int compareTo​(InternationalString object)
        Compares the title with the string representation of the given object for order.
        Specified by:
        compareTo in interface Comparable<InternationalString>
        Parameters:
        object - the object to be compared.
        Returns:
        a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.
      • equals

        public boolean equals​(Object object)
        Returns true if the given object is a SimpleCitation having a title equals to this title.
        Overrides:
        equals in class Object
        Parameters:
        object - the object to compare with this SimpleCitation, or null.
        Returns:
        true if the given object is equals to this SimpleCitation.
      • hashCode

        public int hashCode()
        Returns a hash code value for this citation. The hash code is computed from the title string given to the constructor.
        Overrides:
        hashCode in class Object
        Returns:
        a hash code value for this citation.