Package adams.gui.goe

Class Favorites.Favorite

    • Field Detail

      • m_Name

        protected String m_Name
        the name of the favorite.
      • m_Commandline

        protected String m_Commandline
        the commandline of the favorite.
    • Constructor Detail

      • Favorite

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

      • getName

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

        public String getCommandline()
        Returns the commandline of the favorite.
        Returns:
        the commandline
      • getObject

        public Object getObject()
        Turns the commandline into an object.
        Returns:
        the generated object, or null in case of an error
      • 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