csheets.io
Class CodecFactory

java.lang.Object
  extended by csheets.io.CodecFactory

public class CodecFactory
extends Object

A factory for codecs.

Author:
Einar Pehrson

Constructor Summary
CodecFactory()
          Creates a new codec factory.
 
Method Summary
 Codec getCodec(File file)
          Returns the appropriate codec for the given file.
 Codec getCodec(String extension)
          Returns the appropriate codec for the given filename extension.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CodecFactory

public CodecFactory()
Creates a new codec factory.

Method Detail

getCodec

public Codec getCodec(File file)
Returns the appropriate codec for the given file.

Parameters:
file - the file to use
Returns:
the appropriate codec, or null if none could be found

getCodec

public Codec getCodec(String extension)
Returns the appropriate codec for the given filename extension.

Parameters:
extension - the filename extension of the file to use
Returns:
the appropriate codec, or null if none could be found