⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 logreader.html

📁 用JAVA编写的,在做实验的时候留下来的,本来想删的,但是传上来,大家分享吧
💻 HTML
📖 第 1 页 / 共 4 页
字号:
</TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static&nbsp;java.lang.String[]</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../org/archive/crawler/util/LogReader.html#getByRegExpr(java.io.InputStreamReader, java.lang.String, int, boolean, int, int, long)">getByRegExpr</A></B>(java.io.InputStreamReader&nbsp;reader,             java.lang.String&nbsp;regExpr,             int&nbsp;addLines,             boolean&nbsp;prependLineNumbers,             int&nbsp;skipFirstMatches,             int&nbsp;numberOfMatches,             long&nbsp;logsize)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns all lines in a log/file matching a given regular expression.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static&nbsp;java.lang.String[]</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../org/archive/crawler/util/LogReader.html#getByRegExpr(java.io.InputStreamReader, java.lang.String, java.lang.String, boolean, int, int, long)">getByRegExpr</A></B>(java.io.InputStreamReader&nbsp;reader,             java.lang.String&nbsp;regExpr,             java.lang.String&nbsp;addLines,             boolean&nbsp;prependLineNumbers,             int&nbsp;skipFirstMatches,             int&nbsp;numberOfMatches,             long&nbsp;logsize)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns all lines in a log/file matching a given regular expression.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static&nbsp;java.lang.String[]</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../org/archive/crawler/util/LogReader.html#getByRegExpr(java.lang.String, java.lang.String, int, boolean, int, int)">getByRegExpr</A></B>(java.lang.String&nbsp;aFileName,             java.lang.String&nbsp;regExpr,             int&nbsp;addLines,             boolean&nbsp;prependLineNumbers,             int&nbsp;skipFirstMatches,             int&nbsp;numberOfMatches)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns all lines in a log/file matching a given regular expression.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static&nbsp;java.lang.String[]</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../org/archive/crawler/util/LogReader.html#getByRegExpr(java.lang.String, java.lang.String, java.lang.String, boolean, int, int)">getByRegExpr</A></B>(java.lang.String&nbsp;aFileName,             java.lang.String&nbsp;regExpr,             java.lang.String&nbsp;addLines,             boolean&nbsp;prependLineNumbers,             int&nbsp;skipFirstMatches,             int&nbsp;numberOfMatches)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns all lines in a log/file matching a given regular expression.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static&nbsp;java.lang.String[]</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../org/archive/crawler/util/LogReader.html#getByRegExprFromSeries(java.lang.String, java.lang.String, int, boolean, int, int)">getByRegExprFromSeries</A></B>(java.lang.String&nbsp;aFileName,                       java.lang.String&nbsp;regExpr,                       int&nbsp;addLines,                       boolean&nbsp;prependLineNumbers,                       int&nbsp;skipFirstMatches,                       int&nbsp;numberOfMatches)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns all lines in a log/file matching a given regular expression.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static&nbsp;java.lang.String[]</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../org/archive/crawler/util/LogReader.html#getByRegExprFromSeries(java.lang.String, java.lang.String, java.lang.String, boolean, int, int)">getByRegExprFromSeries</A></B>(java.lang.String&nbsp;aFileName,                       java.lang.String&nbsp;regExpr,                       java.lang.String&nbsp;addLines,                       boolean&nbsp;prependLineNumbers,                       int&nbsp;skipFirstMatches,                       int&nbsp;numberOfMatches)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns all lines in a log/file matching a given regular expression.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static&nbsp;java.lang.String[]</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../org/archive/crawler/util/LogReader.html#getFromSeries(java.lang.String, int, int)">getFromSeries</A></B>(java.lang.String&nbsp;aFileName,              int&nbsp;lineNumber,              int&nbsp;n)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Gets a portion of a log spread across a numbered series of files.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static&nbsp;java.lang.String[]</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../org/archive/crawler/util/LogReader.html#tail(java.io.RandomAccessFile, int)">tail</A></B>(java.io.RandomAccessFile&nbsp;raf,     int&nbsp;n)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Implementation of a unix-like 'tail -n' command</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static&nbsp;java.lang.String[]</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../org/archive/crawler/util/LogReader.html#tail(java.lang.String)">tail</A></B>(java.lang.String&nbsp;aFileName)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Implementation of a unix-like 'tail' command</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static&nbsp;java.lang.String[]</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../org/archive/crawler/util/LogReader.html#tail(java.lang.String, int)">tail</A></B>(java.lang.String&nbsp;aFileName,     int&nbsp;n)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Implementation of a unix-like 'tail -n' command</TD></TR></TABLE>&nbsp;<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"><TH ALIGN="left"><B>Methods inherited from class java.lang.Object</B></TH></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</CODE></TD></TR></TABLE>&nbsp;<P><!-- ========= CONSTRUCTOR DETAIL ======== --><A NAME="constructor_detail"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"><B>Constructor Detail</B></FONT></TH></TR></TABLE><A NAME="LogReader()"><!-- --></A><H3>LogReader</H3><PRE>public <B>LogReader</B>()</PRE><DL></DL><!-- ============ METHOD DETAIL ========== --><A NAME="method_detail"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"><B>Method Detail</B></FONT></TH></TR></TABLE><A NAME="get(java.lang.String)"><!-- --></A><H3>get</H3><PRE>public static java.lang.String <B>get</B>(java.lang.String&nbsp;aFileName)</PRE><DL><DD>Returns the entire file. Useful for smaller files.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>aFileName</CODE> - a file name<DT><B>Returns:</B><DD>The String representation of the entire file.         Null is returned if errors occur (file not found or io exception)</DL></DD></DL><HR><A NAME="get(java.io.InputStreamReader)"><!-- --></A><H3>get</H3><PRE>public static java.lang.String <B>get</B>(java.io.InputStreamReader&nbsp;reader)</PRE><DL><DD>Reads entire contents of reader, returns as string.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>reader</CODE> - <DT><B>Returns:</B><DD>String of entire contents; null for any error.</DL></DD></DL><HR><A NAME="get(java.lang.String, int, int)"><!-- --></A><H3>get</H3><PRE>public static java.lang.String[] <B>get</B>(java.lang.String&nbsp;aFileName,                                     int&nbsp;lineNumber,                                     int&nbsp;n)</PRE><DL><DD>Gets a portion of a log file. Starting at a given line number and the n-1 lines following that one or until the end of the log if that is reached first.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>aFileName</CODE> - The filename of the log/file<DD><CODE>lineNumber</CODE> - The number of the first line to get (if larger then the                    file an empty string will be returned)<DD><CODE>n</CODE> - How many lines to return (total, including the one indicated by                    lineNumber). If smaller then 1 then an empty string                    will be returned.<DT><B>Returns:</B><DD>An array of two strings is returned. At index 0 a portion of the         file starting at lineNumber and reaching lineNumber+n is located.         At index 1 there is an informational string about how large a         segment of the file is being returned.         Null is returned if errors occur (file not found or io exception)</DL></DD></DL><HR><A NAME="getFromSeries(java.lang.String, int, int)"><!-- --></A><H3>getFromSeries</H3><PRE>public static java.lang.String[] <B>getFromSeries</B>(java.lang.String&nbsp;aFileName,                                               int&nbsp;lineNumber,                                               int&nbsp;n)</PRE><DL><DD>Gets a portion of a log spread across a numbered series of files. Starting at a given line number and the n-1 lines following that one or until the end of the log if that is reached first.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>aFileName</CODE> - The filename of the log/file<DD><CODE>lineNumber</CODE> - The number of the first line to get (if larger then the                   file an empty string will be returned)<DD><CODE>n</CODE> - How many lines to return (total, including the one indicated by                    lineNumber). If smaller then 1 then an empty string                    will be returned.<DT><B>Returns:</B><DD>An array of two strings is returned. At index 0 a portion of the         file starting at lineNumber and reaching lineNumber+n is located.         At index 1 there is an informational string about how large a         segment of the file is being returned.         Null is returned if errors occur (file not found or io exception)</DL>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -