Package adams.core.io

Class FilenameProposer

    • Field Detail

      • m_Prefix

        protected String m_Prefix
        the prefix for the files (no path).
      • m_Suffix

        protected String m_Suffix
        the suffix for the files (no dot).
      • m_Directory

        protected String m_Directory
        the default directory.
    • Constructor Detail

      • FilenameProposer

        public FilenameProposer​(String prefix,
                                String suffix)
        Initializes the proposer with the user's home directory as default directory.
        Parameters:
        prefix - the prefix to use
        suffix - the suffix to use
      • FilenameProposer

        public FilenameProposer​(String prefix,
                                String suffix,
                                String directory)
        Initializes the proposer.
        Parameters:
        prefix - the prefix to use
        suffix - the suffix to use
        directory - the default directory
    • 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.
        Overrides:
        toString in class Object
        Returns:
        the representation
      • main

        public static void main​(String[] args)
        For testing only.
        Parameters:
        args - ignored