org.bs.mdi
Class FileFormat

java.lang.Object
  extended byorg.bs.mdi.FileFormat

public class FileFormat
extends Object

Represents a file format.


Constructor Summary
FileFormat(String[] extensions, String description)
          Creates a new file format instance with the given extensions and description.
 
Method Summary
 boolean accept(String filename)
          Returns true if the filename matches this file format.
 String getDescription()
          Returns the description of this file format.
 String[] getExtensions()
          Returns the extensions which this file format is associated with.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileFormat

public FileFormat(String[] extensions,
                  String description)
Creates a new file format instance with the given extensions and description.

Parameters:
extensions - an array of extensions which this FileFormat should be associated with
description - a description of the file format, for example "Text files"
Method Detail

accept

public boolean accept(String filename)
Returns true if the filename matches this file format.

Parameters:
filename - the filename
Returns:
true if the filename matches this format, false otherwise

getExtensions

public String[] getExtensions()
Returns the extensions which this file format is associated with.

Returns:
the extensions

getDescription

public String getDescription()
Returns the description of this file format.

Returns:
the description