gov.nih.nci.caarray.domain.file
Class FileTypeRegistryImpl

java.lang.Object
  extended by gov.nih.nci.caarray.domain.file.FileTypeRegistryImpl
All Implemented Interfaces:
FileTypeRegistry

public class FileTypeRegistryImpl
extends java.lang.Object
implements FileTypeRegistry

Default implementation of FileTypeRegistry.

Author:
dkokotov

Field Summary
 
Fields inherited from interface gov.nih.nci.caarray.domain.file.FileTypeRegistry
MAGE_TAB_IDF, MAGE_TAB_SDRF
 
Constructor Summary
FileTypeRegistryImpl(java.util.Set<gov.nih.nci.caarray.platforms.spi.DataFileHandler> dataHandlers, java.util.Set<gov.nih.nci.caarray.platforms.spi.DesignFileHandler> designHandlers)
          Create a FileTypeRegistryImpl with the set of types provided by the given array data and array design file handlers.
 
Method Summary
 java.util.Set<FileType> getAllTypes()
          
 java.util.Set<FileType> getArrayDesignTypes()
          
 java.util.Set<FileType> getDerivedArrayDataTypes()
          
 java.util.Set<FileType> getMageTabTypes()
          
 java.util.Set<FileType> getParseableArrayDataTypes()
          
 java.util.Set<FileType> getParseableArrayDesignTypes()
          
 java.util.Set<FileType> getRawArrayDataTypes()
          
 FileType getTypeByName(java.lang.String name)
          Look up a type based on its name.
 FileType getTypeFromExtension(java.lang.String filename)
          Determine a file's type based on its extension.
static java.lang.Iterable<java.lang.String> namesForTypes(java.lang.Iterable<FileType> types)
          Return the names of the given FileType instances.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileTypeRegistryImpl

@Inject
public FileTypeRegistryImpl(java.util.Set<gov.nih.nci.caarray.platforms.spi.DataFileHandler> dataHandlers,
                                   java.util.Set<gov.nih.nci.caarray.platforms.spi.DesignFileHandler> designHandlers)
Create a FileTypeRegistryImpl with the set of types provided by the given array data and array design file handlers.

Parameters:
dataHandlers - the known array data handlers, each of which provides types to be added to the registry
designHandlers - the known array design handlers, each of which provides types to be added to the registry
Method Detail

getTypeFromExtension

public FileType getTypeFromExtension(java.lang.String filename)
Determine a file's type based on its extension.

Specified by:
getTypeFromExtension in interface FileTypeRegistry
Parameters:
filename - name of file
Returns:
the FileType corresponding to the file extension or null if no matching file type

getTypeByName

public FileType getTypeByName(java.lang.String name)
Look up a type based on its name.

Specified by:
getTypeByName in interface FileTypeRegistry
Parameters:
name - the type name to find
Returns:
the FileType instance with given name in the registry, or null if none exists

getAllTypes

public java.util.Set<FileType> getAllTypes()

Specified by:
getAllTypes in interface FileTypeRegistry
Returns:
all FileTypes in the registry

getArrayDesignTypes

public java.util.Set<FileType> getArrayDesignTypes()

Specified by:
getArrayDesignTypes in interface FileTypeRegistry
Returns:
all FileTypes with category FileCategory.ARRAY_DESIGN in the registry

getParseableArrayDesignTypes

public java.util.Set<FileType> getParseableArrayDesignTypes()

Specified by:
getParseableArrayDesignTypes in interface FileTypeRegistry
Returns:
all FileTypes with category FileCategory.ARRAY_DESIGN that are parseable in the registry

getRawArrayDataTypes

public java.util.Set<FileType> getRawArrayDataTypes()

Specified by:
getRawArrayDataTypes in interface FileTypeRegistry
Returns:
all FileTypes with category FileCategory.RAW_DATA in the registry

getDerivedArrayDataTypes

public java.util.Set<FileType> getDerivedArrayDataTypes()

Specified by:
getDerivedArrayDataTypes in interface FileTypeRegistry
Returns:
all FileTypes with category FileCategory.DERIVED_DATA in the registry

getParseableArrayDataTypes

public java.util.Set<FileType> getParseableArrayDataTypes()

Specified by:
getParseableArrayDataTypes in interface FileTypeRegistry
Returns:
all FileTypes with category FileCategory.RAW_DATA or FileCategory.DERIVED_DATA that are parsable in the registry

getMageTabTypes

public java.util.Set<FileType> getMageTabTypes()

Specified by:
getMageTabTypes in interface FileTypeRegistry
Returns:
all FileTypes with category FileCategory.MAGE_TAB in the registry

namesForTypes

public static java.lang.Iterable<java.lang.String> namesForTypes(java.lang.Iterable<FileType> types)
Return the names of the given FileType instances.

Parameters:
types - the type instances whose names to return
Returns:
the type names