Class FileParameter

  • All Implemented Interfaces:
    Parameter<java.net.URI>

    public class FileParameter
    extends AbstractParameter<FileParameter,​java.net.URI>
    Parameter class for a parameter specifying a file.
    Since:
    0.3
    Author:
    Steffi Wanka, Erich Schubert
    • Field Detail

      • fileType

        private FileParameter.FileType fileType
        The file type of this file parameter. Specifies if the file is an input of output file.
    • Constructor Detail

      • FileParameter

        public FileParameter​(OptionID optionID,
                             FileParameter.FileType fileType)
        Constructs a file parameter with the given optionID, and file type.
        Parameters:
        optionID - optionID the unique id of the option
        fileType - the file type of this file parameter
    • Method Detail

      • getValueAsString

        public java.lang.String getValueAsString()
        Description copied from interface: Parameter
        Get the value as string. May return null
        Returns:
        Value as string
      • getSyntax

        public java.lang.String getSyntax()
        Returns a string representation of the parameter's type.
        Returns:
        "<file_>"
      • getFileType

        public FileParameter.FileType getFileType()
        Get the file type (input / output)
        Returns:
        file type
      • grab

        public boolean grab​(Parameterization config,
                            java.util.function.Consumer<java.net.URI> consumer)
        Get the parameter.
        Parameters:
        config - Parameterization
        consumer - Output consumer
        Returns:
        true if valid