net.talvi.puffinplot.data
Enum FileType

java.lang.Object
  extended by java.lang.Enum<FileType>
      extended by net.talvi.puffinplot.data.FileType
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<FileType>

public enum FileType
extends java.lang.Enum<FileType>

This fields of this enum represent the types of file that PuffinPlot can read.


Enum Constant Summary
CUSTOM_TABULAR
          A custom tabular file format defined by a FileFormat object
PUFFINPLOT_NEW
          the new PuffinPlot file format
PUFFINPLOT_OLD
          the old PuffinPlot file format
TWOGEE
          DAT file from 2G enterprises Long Core software
UNKNOWN
          unknown file format
ZPLOT
          TXT file in the format used by Steve Hurst's Zplot program
 
Method Summary
static FileType guess(java.io.File file)
          Attempts to guess the type of a file from its name and contents.
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
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

TWOGEE

public static final FileType TWOGEE
DAT file from 2G enterprises Long Core software


ZPLOT

public static final FileType ZPLOT
TXT file in the format used by Steve Hurst's Zplot program


PUFFINPLOT_OLD

public static final FileType PUFFINPLOT_OLD
the old PuffinPlot file format


PUFFINPLOT_NEW

public static final FileType PUFFINPLOT_NEW
the new PuffinPlot file format


CUSTOM_TABULAR

public static final FileType CUSTOM_TABULAR
A custom tabular file format defined by a FileFormat object


UNKNOWN

public static final FileType UNKNOWN
unknown file format

Method Detail

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

guess

public static FileType guess(java.io.File file)
                      throws java.io.IOException
Attempts to guess the type of a file from its name and contents.

Parameters:
file - the file for which to guess the type
Returns:
the type of the file; UNKNOWN if it could not be guessed
Throws:
java.io.IOException - if an I/O error occurred