Class StringFavorites.StringFavorite

    • Field Detail

      • m_Name

        protected String m_Name
        the name of the favorite.
      • m_Data

        protected String m_Data
        the data of the favorite.
    • Constructor Detail

      • StringFavorite

        public StringFavorite​(String name,
                              String data)
        Initializes the favorite.
        Parameters:
        name - the name of the favorite
        data - the commandline of the favorite
    • Method Detail

      • getName

        public String getName()
        Returns the name of the favorite.
        Returns:
        the name
      • getData

        public String getData()
        Returns the data of the favorite.
        Returns:
        the data
      • compareTo

        public int compareTo​(Object o)
        Compares this object with the specified object for order. Returns a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.
        Specified by:
        compareTo in interface Comparable
        Parameters:
        o - 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.
        Throws:
        ClassCastException - if the specified object's type prevents it from being compared to this object.
      • equals

        public boolean equals​(Object obj)
        Indicates whether some other object is "equal to" this one.
        Overrides:
        equals in class Object
        Parameters:
        obj - the reference object with which to compare.
        Returns:
        true if this object is the same as the obj argument; false otherwise.
      • hashCode

        public int hashCode()
        Hashcode so can be used as hashtable key. Returns the hashcode of the name string.
        Overrides:
        hashCode in class Object
        Returns:
        the hashcode, -1 if name is null
      • toString

        public String toString()
        Returns the name of the favorite.
        Overrides:
        toString in class Object
        Returns:
        the name