Package adams.core.io
Class FilenameProposer
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.io.FilenameProposer
-
- All Implemented Interfaces:
LoggingSupporter
,SizeOfHandler
,Serializable
public class FilenameProposer extends LoggingObject
A helper class for proposing file names.- Version:
- $Revision$
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected String
m_Directory
the default directory.protected String
m_Prefix
the prefix for the files (no path).protected String
m_Suffix
the suffix for the files (no dot).-
Fields inherited from class adams.core.logging.LoggingObject
m_Logger, m_LoggingIsEnabled, m_LoggingLevel
-
-
Constructor Summary
Constructors Constructor Description FilenameProposer(String prefix, String suffix)
Initializes the proposer with the user's home directory as default directory.FilenameProposer(String prefix, String suffix, String directory)
Initializes the proposer.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getDirectory()
Returns the directory in use.String
getPrefix()
Returns the prefix in use.String
getSuffix()
Returns the suffix in use.static void
main(String[] args)
For testing only.PlaceholderFile
propose(File basis)
Proposes a file name based on the given file/dir.void
setDirectory(String value)
Sets the directory to use.String
toString()
Returns a string representation of the proposer.-
Methods inherited from class adams.core.logging.LoggingObject
configureLogger, getLogger, getLoggingLevel, initializeLogging, isLoggingEnabled, sizeOf
-
-
-
-
Method Detail
-
getPrefix
public String getPrefix()
Returns the prefix in use.- Returns:
- the prefix
-
getSuffix
public String getSuffix()
Returns the suffix in use.- Returns:
- the suffix
-
setDirectory
public void setDirectory(String value)
Sets the directory to use.- Parameters:
value
- the directory
-
getDirectory
public String getDirectory()
Returns the directory in use.- Returns:
- the directory
-
propose
public PlaceholderFile propose(File basis)
Proposes a file name based on the given file/dir.- Parameters:
basis
- the file/dir to base the propose name on, can be null- Returns:
- the proposed file
-
toString
public String toString()
Returns a string representation of the proposer.
-
main
public static void main(String[] args)
For testing only.- Parameters:
args
- ignored
-
-