|
Cytoscape 3.0.0-beta1 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.cytoscape.io.BasicCyFileFilter
public class BasicCyFileFilter
This is meant to be an basic implementation of CyFileFilter
that can
either be used directly or extended to provide different acceptance criteria.
Only the accepts() methods may be overridden.
Field Summary | |
---|---|
protected DataCategory |
category
Type of data that this filter applies to. |
protected Set<String> |
contentTypes
|
protected String |
description
|
protected Set<String> |
extensions
|
protected StreamUtil |
streamUtil
|
Constructor Summary | |
---|---|
BasicCyFileFilter(Set<String> extensions,
Set<String> contentTypes,
String description,
DataCategory category,
StreamUtil streamUtil)
Creates a file filter from the specified arguments. |
|
BasicCyFileFilter(String[] extensions,
String[] contentTypes,
String description,
DataCategory category,
StreamUtil streamUtil)
Creates a file filter from the specified arguments. |
Method Summary | |
---|---|
boolean |
accepts(InputStream stream,
DataCategory category)
This method always returns false in this particular implementation. |
boolean |
accepts(URI uri,
DataCategory category)
A method that attempts to determine whether the specified URI can be read by the Reader using this filter. |
Set<String> |
getContentTypes()
The MIME content types supported by this filter. |
DataCategory |
getDataCategory()
The DataCategory supported by this filter. |
String |
getDescription()
A short, human readable description of the file extensions suitable for display in FileChoosers. |
protected String |
getExtension(String filename)
Returns a string of the characters following the last '.' in the input string, which is to say the file extension assuming that the input string represents a file name. |
Set<String> |
getExtensions()
Returns a list of file extensions (xml, xgmml, sif) suitable for for use in FileChoosers. |
protected String |
getHeader(InputStream stream,
int numLines)
Returns a string containing the specified number of lines from the beginning of the file. |
String |
toString()
Returns a human readable description of this class. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected final Set<String> extensions
protected final Set<String> contentTypes
protected final String description
protected final StreamUtil streamUtil
protected final DataCategory category
Constructor Detail |
---|
public BasicCyFileFilter(Set<String> extensions, Set<String> contentTypes, String description, DataCategory category, StreamUtil streamUtil)
extensions
- The set of valid extensions for this filter.contentTypes
- The set of valid MIME content types that this filter should
recognize.description
- A human readable description of the filter.category
- The type of data this filter is meant to support.streamUtil
- An instance of the StreamUtil service.public BasicCyFileFilter(String[] extensions, String[] contentTypes, String description, DataCategory category, StreamUtil streamUtil)
extensions
- The set of valid extensions for this filter.contentTypes
- The set of valid MIME content types that this filter should
recognize.description
- A human readable description of the filter.category
- The type of data this filter is meant to support.streamUtil
- An instance of the StreamUtil service.Method Detail |
---|
public boolean accepts(URI uri, DataCategory category)
accepts
in interface CyFileFilter
uri
- The URI to be checked.category
- The data category of URI.
public boolean accepts(InputStream stream, DataCategory category)
accepts
in interface CyFileFilter
stream
- The stream that references the file we'd like to read.category
- The type of input that we're considering.
public final Set<String> getExtensions()
getExtensions
in interface CyFileFilter
public final Set<String> getContentTypes()
getContentTypes
in interface CyFileFilter
public final String getDescription()
getDescription
in interface CyFileFilter
public final DataCategory getDataCategory()
getDataCategory
in interface CyFileFilter
public String toString()
toString
in class Object
protected final String getExtension(String filename)
filename
- the file name as a string.
protected final String getHeader(InputStream stream, int numLines)
stream
- the input stream from which to read the header.numLines
- the number of lines from the beginning of the file.
|
Cytoscape 3.0.0-beta1 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |