📄 filefilter.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Frameset//EN""http://www.w3.org/TR/REC-html40/frameset.dtd"><!--NewPage--><HTML><HEAD><!-- Generated by javadoc on Mon Jul 15 11:49:48 PDT 2002 --><TITLE>: Class FileFilter</TITLE><LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style"></HEAD><BODY BGCOLOR="white"><!-- ========== START OF NAVBAR ========== --><A NAME="navbar_top"><!-- --></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0"><TR><TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"><A NAME="navbar_top_firstrow"><!-- --></A><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3"> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/FileFilter.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> </TR></TABLE></TD><TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM></EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../quicktime/app/image/DSequenceFromMemory.html"><B>PREV CLASS</B></A> <A HREF="../../../quicktime/app/image/GraphicsImporterDrawer.html"><B>NEXT CLASS</B></A></FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../index.html" TARGET="_top"><B>FRAMES</B></A> <A HREF="FileFilter.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD></TR><TR><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: INNER | <A HREF="#field_summary">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">DETAIL: <A HREF="#field_detail">FIELD</A> | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD></TR></TABLE><!-- =========== END OF NAVBAR =========== --><HR><!-- ======== START OF CLASS DATA ======== --><H2><FONT SIZE="-1">quicktime.app.image</FONT><BR>Class FileFilter</H2><PRE>java.lang.Object | +--<B>quicktime.app.image.FileFilter</B></PRE><DL><DT><B>All Implemented Interfaces:</B> <DD>java.io.FilenameFilter</DD></DL><HR><DL><DT>public class <B>FileFilter</B><DT>extends java.lang.Object<DT>implements java.io.FilenameFilter</DL><P>This class is used by the ImageUtil.createSequence call. It is used to filter the contents of a directory and return true to those files that match the pattern that this expects. After the files are selected the array of fileNames accepted are submitted to the postProcess method which returns an array of fileNames which will then be used to create a sequence of images in the order of the files in this array. <P> The filename format that this filter expects is:<BR> <prefix><frameNumber><suffix><BR> Both prefix and suffix can be empty, but <frameNumber> requires that there be at least one numeric character in the name of the file. <P> No sorting is done on the resulting file list, so generally the files will be opened and added to the sequence in alpha/numeric order. So for files to appear in proper numeric order you will need to specify leading zeroes in the frame numbers. <P> You can also pass in a boolean flag to indicate that the filter should ignore the suffix of the filename when matching. <P> Subclasses can overide or extend the methods to provide custom filtering operations.<P><HR><P><!-- ======== INNER CLASS SUMMARY ======== --><!-- =========== FIELD SUMMARY =========== --><A NAME="field_summary"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=2><FONT SIZE="+2"><B>Field Summary</B></FONT></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>protected java.lang.String</CODE></FONT></TD><TD><CODE><B><A HREF="../../../quicktime/app/image/FileFilter.html#prefix">prefix</A></B></CODE><BR> The prefix of the file to be matched.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>protected java.lang.String</CODE></FONT></TD><TD><CODE><B><A HREF="../../../quicktime/app/image/FileFilter.html#suffix">suffix</A></B></CODE><BR> The suffix of the file to be matched.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>protected boolean</CODE></FONT></TD><TD><CODE><B><A HREF="../../../quicktime/app/image/FileFilter.html#testSuffix">testSuffix</A></B></CODE><BR> If true (the default) then both the suffix and prefix are used to match the filename.</TD></TR></TABLE> <!-- ======== CONSTRUCTOR SUMMARY ======== --><A NAME="constructor_summary"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=2><FONT SIZE="+2"><B>Constructor Summary</B></FONT></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><B><A HREF="../../../quicktime/app/image/FileFilter.html#FileFilter()">FileFilter</A></B>()</CODE><BR> Create the filter with the default setting of testing both prefix and suffix</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><B><A HREF="../../../quicktime/app/image/FileFilter.html#FileFilter(boolean)">FileFilter</A></B>(boolean testSuffix)</CODE><BR> Create the filter with the flag set (if true - the default) which will test the suffix and prefix or if false it will test the prefix only</TD></TR></TABLE> <!-- ========== METHOD SUMMARY =========== --><A NAME="method_summary"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=2><FONT SIZE="+2"><B>Method Summary</B></FONT></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> boolean</CODE></FONT></TD><TD><CODE><B><A HREF="../../../quicktime/app/image/FileFilter.html#accept(java.io.File, java.lang.String)">accept</A></B>(java.io.File dir, java.lang.String fName)</CODE><BR> This method is used by the createSequence call to filter the files found in the supplied directory.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>protected void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../quicktime/app/image/FileFilter.html#extractPrefixAndSuffix(java.lang.String)">extractPrefixAndSuffix</A></B>(java.lang.String fName)</CODE><BR> It dissects the incoming fName (the name of a file) into a prefix which are all the characters of the fileName that precede the last occurance of a number in the filename and a suffix the extracts the characters that immediately follow the last occurance of a number in the fName.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>protected java.lang.String[]</CODE></FONT></TD><TD><CODE><B><A HREF="../../../quicktime/app/image/FileFilter.html#postProcess(java.lang.String[])">postProcess</A></B>(java.lang.String[] matchedFiles)</CODE><BR> This method is called after the directory has been filtered.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>protected int</CODE></FONT></TD><TD><CODE><B><A HREF="../../../quicktime/app/image/FileFilter.html#testFrameNumber(java.lang.String)">testFrameNumber</A></B>(java.lang.String fName)</CODE><BR> This method tests the frameNumber portion of the filename.</TD></TR></TABLE> <A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -