|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.washington.biostr.sig.vault.files.AbstractFileType
public abstract class AbstractFileType
| Field Summary |
|---|
| Fields inherited from interface edu.washington.biostr.sig.vault.files.FileType |
|---|
ACCEPTABLE, DISCOURAGED, PREFERRED |
| Constructor Summary | |
|---|---|
protected |
AbstractFileType(String name,
String[] extensions,
Icon image,
int preference,
boolean decodable,
boolean encodable)
|
| Method Summary | |
|---|---|
boolean |
accept(FileType type)
|
int |
compareTo(FileType o)
compareTo compares the acceptable extensions. |
protected static int |
count(String str,
char object)
|
boolean |
equals(Object parm1)
Two filters are equal if they accept the same thing for all values. |
Icon |
getDefaultIcon(String file)
A filetype can optionally have an icon. |
String |
getExtension(int extensionNum)
|
protected SortedSet<String> |
getExtensions()
Return a set of extension objects. |
protected String |
getMeaningfulPart(URI uri)
|
String |
getName()
|
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(); |
FileType |
getType(URI[] group)
If this type supports subtypes, get the subtype for this group. |
protected boolean |
hasAllExtensions(Collection<String> filenames)
Check that the list has all of the given extensions. |
protected boolean |
hasAllExtensions(URI[] filenames)
|
protected String |
hasExtension(URI uri)
Check the filename to see if it has one of the accepted extensions. |
int |
hashCode()
|
boolean |
isDecodable()
|
boolean |
isEncodable()
|
URI[] |
next(SortedSet<URI> files)
Get the next set of files that match this type and remove them from files. |
AbstractFileType |
setName(String name)
Change the name |
protected String |
stripCompressionExtensions(String name)
|
String |
toString()
|
String |
toString(FileGroup group)
Get the preferred string for this group. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface edu.washington.biostr.sig.vault.files.FileType |
|---|
accept, accept, generateFiles |
| Constructor Detail |
|---|
protected AbstractFileType(String name,
String[] extensions,
Icon image,
int preference,
boolean decodable,
boolean encodable)
| Method Detail |
|---|
protected static int count(String str,
char object)
protected SortedSet<String> getExtensions()
protected String hasExtension(URI uri)
filename -
protected String stripCompressionExtensions(String name)
protected boolean hasAllExtensions(Collection<String> filenames)
filenames -
protected String getMeaningfulPart(URI uri)
protected boolean hasAllExtensions(URI[] filenames)
public boolean accept(FileType type)
accept in interface FileTypepublic String getName()
public int hashCode()
hashCode in class Objectpublic boolean equals(Object parm1)
equals in class Objectparm1 -
public AbstractFileType setName(String name)
name -
public int compareTo(FileType o)
compareTo in interface Comparable<FileType>o -
public FileType getType(URI[] group)
FileType
getType in interface FileTypepublic Icon getDefaultIcon(String file)
FileType
getDefaultIcon in interface FileTypepublic String toString()
toString in class Objectpublic int getSortingSpot()
FileType
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:
- 1000.
public URI[] next(SortedSet<URI> files)
FileType
next in interface FileTypefiles - An list of files alphabatized using String's compareTo method.
public int getPreference()
FileType
getPreference in interface FileTypepublic String toString(FileGroup group)
FileType
toString in interface FileTypepublic boolean isDecodable()
isDecodable in interface FileTypepublic boolean isEncodable()
isEncodable in interface FileTypepublic String getExtension(int extensionNum)
getExtension in interface FileType
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||