edu.washington.biostr.sig.brainj3d.data
Class CodecFactory

java.lang.Object
  extended by edu.washington.biostr.sig.brainj3d.data.CodecFactory

public class CodecFactory
extends Object

This stores mappings of types to encoders/decoders and data classes to encoders. Note: This class is not threadsafe.

Version:
1.0
Author:
not attributable

Constructor Summary
CodecFactory()
           
 
Method Summary
static void addDecoder(FileType type, Class<? extends Decoder> decoder)
          We only currently support 1 decoder per type.
static void addDecoder(FileType type, Decoder decoder)
          We only currently support 1 decoder per type.
static void addEncoder(FileType type, Class<? extends Encoder> encoder)
          We only support 1 encoder per type.
static void addEncoder(FileType type, Encoder encoder)
          We only support 1 encoder per type.
static Decoder getDecoder(FileType type)
          Get the decoder for the specified type.
static Map<FileType,Decoder> getDecoders()
          Get a map of types->decoders.
static Encoder getEncoder(Class<? extends Data> type)
          Get the encoder for the specified type.
static Encoder getEncoder(FileType type)
          Get the encoder for the specified type.
static Map<FileType,Encoder> getEncoders()
          Get a map of types->decoders.
static void getTypesForData(Class<? extends Data> data, Collection<? super FileType> types)
          Look up a class of data and add all of the types that produce that data to types
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CodecFactory

public CodecFactory()
Method Detail

getTypesForData

public static void getTypesForData(Class<? extends Data> data,
                                   Collection<? super FileType> types)
Look up a class of data and add all of the types that produce that data to types

Parameters:
data -
types -

addDecoder

public static void addDecoder(FileType type,
                              Decoder decoder)
We only currently support 1 decoder per type.

Parameters:
type -
decoder -

addEncoder

public static void addEncoder(FileType type,
                              Encoder encoder)
We only support 1 encoder per type.

Parameters:
type -
encoder -

addDecoder

public static void addDecoder(FileType type,
                              Class<? extends Decoder> decoder)
                       throws IllegalAccessException,
                              InstantiationException
We only currently support 1 decoder per type.

Parameters:
type -
decoder -
Throws:
IllegalAccessException
InstantiationException

addEncoder

public static void addEncoder(FileType type,
                              Class<? extends Encoder> encoder)
                       throws IllegalAccessException,
                              InstantiationException
We only support 1 encoder per type.

Parameters:
type -
encoder -
Throws:
IllegalAccessException
InstantiationException

getDecoder

public static Decoder getDecoder(FileType type)
Get the decoder for the specified type. If null is returned, there is no decoder for that type.

Parameters:
type -
Returns:

getEncoder

public static Encoder getEncoder(FileType type)
Get the encoder for the specified type. If null is returned, there is no encoder for that type.

Parameters:
type -
Returns:

getEncoder

public static Encoder getEncoder(Class<? extends Data> type)
Get the encoder for the specified type. If null is returned, there is no encoder for that type.

Parameters:
type -
Returns:

getDecoders

public static Map<FileType,Decoder> getDecoders()
Get a map of types->decoders. This map should not be modified.

Returns:

getEncoders

public static Map<FileType,Encoder> getEncoders()
Get a map of types->decoders. This map should not be modified.

Returns:


Copyright © 2006 University of Washington. All Rights Reserved.