edu.washington.biostr.sig.vault.files
Class AllTypes

java.lang.Object
  extended by edu.washington.biostr.sig.vault.files.AllTypes
All Implemented Interfaces:
FileType, Comparable<FileType>

public class AllTypes
extends Object
implements FileType

Author:
eider

Field Summary
 
Fields inherited from interface edu.washington.biostr.sig.vault.files.FileType
ACCEPTABLE, DISCOURAGED, PREFERRED
 
Constructor Summary
AllTypes()
           
 
Method Summary
 boolean accept(FileType other)
           
 URI[] accept(SortedSet<URI> files, URI filename)
          Return the fileset if the given name is acceptable and it exists in the specified directory.
 boolean accept(URI[] group)
           
 int compareTo(FileType o)
          This equals AllType's, is larger than all FileType's
 URI[] generateFiles(URI filename)
          Create full filenames from the given filename.
 Icon getDefaultIcon(String file)
          A filetype can optionally have an icon.
 String getExtension(int extensionNum)
           
 int getPreference()
          Return PREFERRED, ACCEPTABLE (default) or DISCOURAGED.
 int getSortingSpot()
          To ensure that nodes are comparable across different types, when comparing different types, simply return:
int value = getSortingSpot() - other.getSortingSpot();
if (value == 0)
{
value = toString().compareTo(other.toString());
if (value == 0)
{
return getClass().getName().compareTo(other.getClass().getName());
}
}
return value;
 FileType getType(URI[] group)
          If this type supports subtypes, get the subtype for this group.
 boolean isDecodable()
           
 boolean isEncodable()
           
 URI[] next(SortedSet<URI> files)
          Get the next set of files that match this type and remove them from files.
 String toString(FileGroup group)
          Get the preferred string for this group.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AllTypes

public AllTypes()
Method Detail

accept

public boolean accept(FileType other)
Specified by:
accept in interface FileType

accept

public boolean accept(URI[] group)
Specified by:
accept in interface FileType

next

public URI[] next(SortedSet<URI> files)
Description copied from interface: FileType
Get the next set of files that match this type and remove them from files. Return null if there is no matching set.
Currently it is only required to get the next set that start at 0.

Specified by:
next in interface FileType
Parameters:
files - An list of files alphabatized using String's compareTo method.
Returns:

getDefaultIcon

public Icon getDefaultIcon(String file)
Description copied from interface: FileType
A filetype can optionally have an icon.

Specified by:
getDefaultIcon in interface FileType
Returns:

getType

public FileType getType(URI[] group)
Description copied from interface: FileType
If this type supports subtypes, get the subtype for this group.

Specified by:
getType in interface FileType
Returns:

generateFiles

public URI[] generateFiles(URI filename)
Description copied from interface: FileType
Create full filenames from the given filename. It also strips off the extension (it assumes that the length is the length of the longest extension that is part of the type). Query parts are not handled.

Specified by:
generateFiles in interface FileType
Returns:

compareTo

public int compareTo(FileType o)
This equals AllType's, is larger than all FileType's

Specified by:
compareTo in interface Comparable<FileType>
See Also:
Comparable.compareTo(java.lang.Object)

getSortingSpot

public int getSortingSpot()
Description copied from interface: FileType
To ensure that nodes are comparable across different types, when comparing different types, simply return:
int value = getSortingSpot() - other.getSortingSpot();
if (value == 0)
{
value = toString().compareTo(other.toString());
if (value == 0)
{
return getClass().getName().compareTo(other.getClass().getName());
}
}
return value;

Specified by:
getSortingSpot in interface FileType
Returns:
120321430

accept

public URI[] accept(SortedSet<URI> files,
                    URI filename)
Description copied from interface: FileType
Return the fileset if the given name is acceptable and it exists in the specified directory.

Specified by:
accept in interface FileType
Returns:

getPreference

public int getPreference()
Description copied from interface: FileType
Return PREFERRED, ACCEPTABLE (default) or DISCOURAGED.

Specified by:
getPreference in interface FileType
Returns:

toString

public String toString(FileGroup group)
Description copied from interface: FileType
Get the preferred string for this group.

Specified by:
toString in interface FileType
Returns:

isDecodable

public boolean isDecodable()
Specified by:
isDecodable in interface FileType
Returns:
true f there is a decoder for this type.

isEncodable

public boolean isEncodable()
Specified by:
isEncodable in interface FileType
Returns:
true if there is an encoder for this type.

getExtension

public String getExtension(int extensionNum)
Specified by:
getExtension in interface FileType


Copyright © 2006 University of Washington. All Rights Reserved.