Package adams.gui.tools.previewbrowser
Class ContentHandlerFavorites.ContentHandlerFavorite
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.gui.tools.previewbrowser.ContentHandlerFavorites.ContentHandlerFavorite
-
- All Implemented Interfaces:
LoggingSupporter
,SizeOfHandler
,Serializable
,Comparable<ContentHandlerFavorites.ContentHandlerFavorite>
- Enclosing class:
- ContentHandlerFavorites
public static class ContentHandlerFavorites.ContentHandlerFavorite extends LoggingObject implements Comparable<ContentHandlerFavorites.ContentHandlerFavorite>
Encapsulates a single favorite.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected String
m_Commandline
the handler commandline.protected String
m_Extension
the extension.protected String
m_Name
the name of the favorite.-
Fields inherited from class adams.core.logging.LoggingObject
m_Logger, m_LoggingIsEnabled, m_LoggingLevel
-
-
Constructor Summary
Constructors Constructor Description ContentHandlerFavorite(String ext, String name, ContentHandler handler)
Initializes the favorite.ContentHandlerFavorite(String ext, String name, String cmdline)
Initializes the favorite.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareTo(ContentHandlerFavorites.ContentHandlerFavorite o)
Compares this object with the specified object for order.boolean
equals(Object o)
Checks whether the object is the same as itself (using the name).String
getCommandline()
Returns the commandline of the favorite.String
getExtension()
Returns the extension of the favorite.ContentHandler
getHandler()
Returns a new handler instance.String
getName()
Returns the name of the favorite.int
hashCode()
Returns the hash code of the name.String
toString()
Returns a string representation of the object.-
Methods inherited from class adams.core.logging.LoggingObject
configureLogger, getLogger, getLoggingLevel, initializeLogging, isLoggingEnabled, sizeOf
-
-
-
-
Constructor Detail
-
ContentHandlerFavorite
public ContentHandlerFavorite(String ext, String name, ContentHandler handler)
Initializes the favorite.- Parameters:
ext
- the extensionname
- the namehandler
- the handler
-
-
Method Detail
-
getExtension
public String getExtension()
Returns the extension of the favorite.- Returns:
- the extension
-
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
-
getHandler
public ContentHandler getHandler()
Returns a new handler instance.- Returns:
- the instance, null if failed to instantiate
-
toString
public String toString()
Returns a string representation of the object.
-
compareTo
public int compareTo(ContentHandlerFavorites.ContentHandlerFavorite 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. Just uses the name.- Specified by:
compareTo
in interfaceComparable<ContentHandlerFavorites.ContentHandlerFavorite>
- 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:
NullPointerException
- if the specified object is nullClassCastException
- if the specified object's type prevents it from being compared to this object.
-
equals
public boolean equals(Object o)
Checks whether the object is the same as itself (using the name).
-
-