nl.liacs.subdisc
Enum FileType
java.lang.Object
java.lang.Enum<FileType>
nl.liacs.subdisc.FileType
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Comparable<FileType>
public enum FileType
- extends java.lang.Enum<FileType>
Field Summary |
java.lang.String |
DESCRIPTION
The description used in a JFileChooser . |
Method Summary |
static FileType |
getFileType(java.io.File theFile)
Returns the FileType corresponding to the filename parameter. |
static java.lang.String |
removeExtension(java.io.File theFile)
Returns a String for a File that is equal to
File.getName() , but with the extension removed (that is
everything starting from the last '.'). |
static FileType |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. |
static FileType[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared. |
Methods inherited from class java.lang.Enum |
compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf |
Methods inherited from class java.lang.Object |
getClass, notify, notifyAll, wait, wait, wait |
TXT
public static final FileType TXT
ARFF
public static final FileType ARFF
XML
public static final FileType XML
ALL_DATA_FILES
public static final FileType ALL_DATA_FILES
DESCRIPTION
public final java.lang.String DESCRIPTION
- The description used in a
JFileChooser
.
values
public static FileType[] values()
- Returns an array containing the constants of this enum type, in
the order they are declared. This method may be used to iterate
over the constants as follows:
for (FileType c : FileType.values())
System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in
the order they are declared
valueOf
public static FileType valueOf(java.lang.String name)
- Returns the enum constant of this type with the specified name.
The string must match exactly an identifier used to declare an
enum constant in this type. (Extraneous whitespace characters are
not permitted.)
- Parameters:
name
- the name of the enum constant to be returned.
- Returns:
- the enum constant with the specified name
- Throws:
java.lang.IllegalArgumentException
- if this enum type has no constant
with the specified name
java.lang.NullPointerException
- if the argument is null
removeExtension
public static java.lang.String removeExtension(java.io.File theFile)
- Returns a
String
for a File
that is equal to
File.getName()
, but with the extension removed (that is
everything starting from the last '.').
- Parameters:
theFile
- the File from which to remove the extension.
- Returns:
- a
String
of the File.getName()
for the
parameter, with the extension removed, or the empty Sting
if
the parameter is null
.
getFileType
public static FileType getFileType(java.io.File theFile)
- Returns the FileType corresponding to the filename parameter. The
filename will be checked for its extension, and if the extension is
registered with a FileType, that FileType will be returned.
- Parameters:
theFile
- the File
to get the FileType for.
- Returns:
- the FileType for the parameter, if the parameters' extension is
known,
null
otherwise.