Package adams.gui.goe
Class Favorites.Favorite
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.gui.goe.Favorites.Favorite
-
- All Implemented Interfaces:
CloneHandler<Favorites.Favorite>
,LoggingSupporter
,SizeOfHandler
,Serializable
,Comparable
- Enclosing class:
- Favorites
public static class Favorites.Favorite extends LoggingObject implements Comparable, CloneHandler<Favorites.Favorite>
Container class for a favorite setup.- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected boolean
m_Array
whether it is an array.protected String
m_Commandline
the commandline of the favorite.protected Class
m_ComponentClass
the component class (in case of arrays).protected String
m_Name
the name of the favorite.-
Fields inherited from class adams.core.logging.LoggingObject
m_Logger, m_LoggingIsEnabled, m_LoggingLevel
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareTo(Object o)
Compares this object with the specified object for order.boolean
equals(Object obj)
Indicates whether some other object is "equal to" this one.Favorites.Favorite
getClone()
Returns a copy of itself.String
getCommandline()
Returns the commandline of the favorite.Class
getComponentClass()
Returns the component class used by the array.String
getName()
Returns the name of the favorite.Object
getObject()
Turns the commandline into an object.int
hashCode()
Hashcode so can be used as hashtable key.boolean
isArray()
Returns whether the command-line represents an array.String
toString()
Returns the name of the favorite.-
Methods inherited from class adams.core.logging.LoggingObject
configureLogger, getLogger, getLoggingLevel, initializeLogging, isLoggingEnabled, sizeOf
-
-
-
-
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
-
getClone
public Favorites.Favorite getClone()
Returns a copy of itself.- Specified by:
getClone
in interfaceCloneHandler<Favorites.Favorite>
- Returns:
- the copy
-
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 interfaceComparable
- 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.
-
hashCode
public int hashCode()
Hashcode so can be used as hashtable key. Returns the hashcode of the name string.
-
-