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.
      • m_Array

        protected boolean m_Array
        whether it is an array.
      • m_ComponentClass

        protected Class m_ComponentClass
        the component class (in case of arrays).
    • 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
      • Favorite

        public Favorite​(String name,
                        String cmd,
                        boolean array,
                        Class componentClass)
        Initializes the favorite.
        Parameters:
        name - the name of the favorite
        cmd - the commandline of the favorite
        array - whether this commandline represents an array
        componentClass - the base class of the array
    • 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
      • isArray

        public boolean isArray()
        Returns whether the command-line represents an array.
        Returns:
        true if array
      • getComponentClass

        public Class getComponentClass()
        Returns the component class used by the array.
        Returns:
        the class (null if not an array)
      • 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