Jalopy 1.0b10

de.hunsicker.io
Class FileFormat

java.lang.Object
  |
  +--de.hunsicker.io.FileFormat

public final class FileFormat
extends Object

Represents the file format of a platform. The file format is defined by the line separator the platform uses.

Version:
$Revision: 1.3 $
Author:
Marco Hunsicker

Field Summary
static FileFormat AUTO
          Indicates that the file format should be auto-detected.
static FileFormat DEFAULT
          Represents the platform default file format.
static FileFormat DOS
          Represents the DOS file format ("\r\n").
static FileFormat MAC
          Represents the Mac file format ("\r").
static FileFormat UNIX
          Represents the Unix file format ("\n").
static FileFormat UNKNOWN
          Represents an unknown or not yet determined file format.
 
Method Summary
 String getLineSeparator()
          Returns the characteristic line separator of the file format.
 String getName()
          Returns the descriptive name of the file format.
 String toString()
          Returns a string representation of this object.
static FileFormat valueOf(String format)
          Returns the FileFormat object for the given file format string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DEFAULT

public static final FileFormat DEFAULT
Represents the platform default file format.

AUTO

public static final FileFormat AUTO
Indicates that the file format should be auto-detected.

DOS

public static final FileFormat DOS
Represents the DOS file format ("\r\n").

MAC

public static final FileFormat MAC
Represents the Mac file format ("\r").

UNIX

public static final FileFormat UNIX
Represents the Unix file format ("\n").

UNKNOWN

public static final FileFormat UNKNOWN
Represents an unknown or not yet determined file format.
Method Detail

getLineSeparator

public String getLineSeparator()
Returns the characteristic line separator of the file format. Note that both UNKNOWN and AUTO does not have distinct line separators and therefore rather return the platform default separator.
Returns:
the line separator of the file format. Either "\r\n" or "\n" or "\r"

getName

public String getName()
Returns the descriptive name of the file format.
Returns:
the name of the file format.

valueOf

public static FileFormat valueOf(String format)
Returns the FileFormat object for the given file format string.
Parameters:
format - a valid format string. Either "\r\n" or "DOS", "\n" or "UNIX", "\r" or "MAC", "auto" or "default" (case-insensitive).
Returns:
the FileFormat object for the given format string. Returns DEFAULT if format == null or format does not denote a valid file format string.

toString

public String toString()
Returns a string representation of this object.
Overrides:
toString in class Object
Returns:
a string representation of this object.
See Also:
getLineSeparator()

Jalopy 1.0b10

Submit a bug or feature.

For further information and documentation, visit the official Jalopy website.
This page generated: November 14 2002