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

java.lang.Object
  extended by gov.nih.nci.caarray.domain.file.FileType
All Implemented Interfaces:
java.lang.Comparable<FileType>

public class FileType
extends java.lang.Object
implements java.lang.Comparable<FileType>

Describes a type of file that can be uploaded to caArray. This is not a persistent bean - instances of this class are registered with FileTypeRegistry by platform plugins which know how to parse particular file types.


Constructor Summary
FileType()
          create an uninitialized file type.
FileType(java.lang.String name, FileCategory category, boolean parsed, boolean dataMatrix, java.lang.String... extensions)
          Constructs a file type with given properties.
FileType(java.lang.String name, FileCategory category, boolean parsed, java.lang.String... extensions)
          Constructs a file type with given properties.
 
Method Summary
 int compareTo(FileType ft)
          
 boolean equals(java.lang.Object obj)
          
 FileCategory getCategory()
           
 java.util.Set<java.lang.String> getExtensions()
           
 java.lang.String getName()
           
 int hashCode()
          
 boolean isArrayData()
           
 boolean isArrayDesign()
           
 boolean isDataMatrix()
           
 boolean isDerivedArrayData()
           
 boolean isMageTab()
           
 boolean isParseableArrayDesign()
           
 boolean isParseableData()
           
 boolean isParsed()
           
 boolean isRawArrayData()
           
 void setCategory(FileCategory category)
           
 void setDataMatrix(boolean dataMatrix)
           
 void setExtensions(java.util.Set<java.lang.String> extensions)
           
 void setName(java.lang.String name)
           
 void setParsed(boolean parsed)
           
 java.lang.String toString()
          
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FileType

public FileType()
create an uninitialized file type. mostly for dozer and other tooling frameworks, should avoid using in client code.


FileType

public FileType(java.lang.String name,
                FileCategory category,
                boolean parsed,
                java.lang.String... extensions)
Constructs a file type with given properties.

Parameters:
name - type name. Names should be unique across all types registered in the type registry
extensions - the extensions associated with this type. files whose names end in these extensions should be considered to have this type.
category - the category to which files of this type belong.
parsed - whether this type can be parsed

FileType

public FileType(java.lang.String name,
                FileCategory category,
                boolean parsed,
                boolean dataMatrix,
                java.lang.String... extensions)
Constructs a file type with given properties.

Parameters:
name - type name. Names should be unique across all types registered in the type registry
extensions - the extensions associated with this type. files whose names end in these extensions should be considered to have this type.
category - the category to which files of this type belong.
parsed - whether this type can be parsed
dataMatrix - whether files of this type are data matrices
Method Detail

isDataMatrix

public boolean isDataMatrix()
Returns:
whether this is a data matrix type

setDataMatrix

public void setDataMatrix(boolean dataMatrix)
Parameters:
dataMatrix - the dataMatrix to set

getExtensions

public java.util.Set<java.lang.String> getExtensions()
Returns:
the extensions associated with this type

setExtensions

public void setExtensions(java.util.Set<java.lang.String> extensions)
Parameters:
extensions - the extensions to set

getCategory

public FileCategory getCategory()
Returns:
the category to which files of this type belong

setCategory

public void setCategory(FileCategory category)
Parameters:
category - the category to set

getName

public java.lang.String getName()
Returns:
the name of the type

setName

public void setName(java.lang.String name)
Parameters:
name - the name to set

isParsed

public boolean isParsed()
Returns:
whether files of this type can be parsed

setParsed

public void setParsed(boolean parsed)
Parameters:
parsed - the parsed to set

isArrayDesign

public boolean isArrayDesign()
Returns:
true if this file type is an array design.

isParseableArrayDesign

public boolean isParseableArrayDesign()
Returns:
true if the system supports parsing this array design format.

isParseableData

public boolean isParseableData()
Returns:
true if the system supports parsing this data format.

isDerivedArrayData

public boolean isDerivedArrayData()
Returns:
true if the file type is used for derived array data.

isRawArrayData

public boolean isRawArrayData()
Returns:
true if the file type is used for derived array data.

isMageTab

public boolean isMageTab()
Returns:
true if the file type is used for mage tab annotations.

isArrayData

public boolean isArrayData()
Returns:
true if this file type is array data.

equals

public boolean equals(java.lang.Object obj)

Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()

Overrides:
hashCode in class java.lang.Object

compareTo

public int compareTo(FileType ft)

Specified by:
compareTo in interface java.lang.Comparable<FileType>

toString

public java.lang.String toString()

Overrides:
toString in class java.lang.Object