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 booleanm_Arraywhether it is an array.protected Stringm_Commandlinethe commandline of the favorite.protected Classm_ComponentClassthe component class (in case of arrays).protected Stringm_Namethe 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 intcompareTo(Object o)Compares this object with the specified object for order.booleanequals(Object obj)Indicates whether some other object is "equal to" this one.Favorites.FavoritegetClone()Returns a copy of itself.StringgetCommandline()Returns the commandline of the favorite.ClassgetComponentClass()Returns the component class used by the array.StringgetName()Returns the name of the favorite.ObjectgetObject()Turns the commandline into an object.inthashCode()Hashcode so can be used as hashtable key.booleanisArray()Returns whether the command-line represents an array.StringtoString()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:
getClonein 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:
compareToin 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.
-
-