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 Stringm_Directorythe default directory.protected Stringm_Prefixthe prefix for the files (no path).protected Stringm_Suffixthe 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 StringgetDirectory()Returns the directory in use.StringgetPrefix()Returns the prefix in use.StringgetSuffix()Returns the suffix in use.static voidmain(String[] args)For testing only.PlaceholderFilepropose(File basis)Proposes a file name based on the given file/dir.voidsetDirectory(String value)Sets the directory to use.StringtoString()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
-
-