com.infoteria.asteria.log.parser
Class LogReader

java.lang.Object
  |
  +--com.infoteria.asteria.log.parser.LogReader
Direct Known Subclasses:
ReverseLogReader

public class LogReader
extends Object

ASTERIAのログを1行づつ読み出すクラスです。


Constructor Summary
protected LogReader()
          LogReaderを作成します。
  LogReader(File f)
          Fileを指定してLogReaderを作成します。
  LogReader(File f, String encoding)
          Fileとエンコーディングを指定してLogReaderを作成します。
  LogReader(InputStream is)
          InputStreamを指定してLogReaderを作成します。
  LogReader(InputStream is, String encoding)
          InputStreamとエンコーディングを指定してLogReaderを作成します。
 
Method Summary
 void close()
          LogReaderをクローズします。
ログを読み終わったら必ずクローズしなければなりません。
 String getCurrentDateStr()
          最後に読んだ行の日時を返します。
 long getCurrentLineNumber()
          最後に読んだ行の行番号を返します。
 LogItem getLogItem(long lineNumber)
          行番号を指定してLogItemを取得します。
読み込み状態がその行を過ぎている場合はIOExceptionになります。
 LogItem getLogItem(String dateStr)
          日付文字列を指定してLogItemを取得します。
読み込み状態がその行を過ぎている場合はIOExceptionになります。
 SkipInfo getSkipInfo()
          インデックスを返します
static boolean isLogLine(String s)
           
 LogItem read()
          次のLogItemを読み出します。
 LogItem read(LogFilter filter)
          指定のフィルターにマッチする次のLogItemを読み出します。
 void setLogItemBuilder(LogItemBuilder builder)
           
 void setSkipInfo(SkipInfo info)
          インデックスを設定します
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LogReader

protected LogReader()
             throws IOException
LogReaderを作成します。

LogReader

public LogReader(File f)
          throws IOException
Fileを指定してLogReaderを作成します。

LogReader

public LogReader(File f,
                 String encoding)
          throws IOException
Fileとエンコーディングを指定してLogReaderを作成します。

LogReader

public LogReader(InputStream is)
          throws IOException
InputStreamを指定してLogReaderを作成します。

LogReader

public LogReader(InputStream is,
                 String encoding)
          throws IOException
InputStreamとエンコーディングを指定してLogReaderを作成します。
Method Detail

getSkipInfo

public SkipInfo getSkipInfo()
インデックスを返します

setSkipInfo

public void setSkipInfo(SkipInfo info)
インデックスを設定します

close

public void close()
           throws IOException
LogReaderをクローズします。
ログを読み終わったら必ずクローズしなければなりません。

getCurrentLineNumber

public long getCurrentLineNumber()
最後に読んだ行の行番号を返します。

getCurrentDateStr

public String getCurrentDateStr()
最後に読んだ行の日時を返します。

getLogItem

public LogItem getLogItem(long lineNumber)
                   throws IOException
行番号を指定してLogItemを取得します。
読み込み状態がその行を過ぎている場合はIOExceptionになります。

getLogItem

public LogItem getLogItem(String dateStr)
                   throws IOException
日付文字列を指定してLogItemを取得します。
読み込み状態がその行を過ぎている場合はIOExceptionになります。

read

public LogItem read()
             throws IOException
次のLogItemを読み出します。

isLogLine

public static boolean isLogLine(String s)

read

public LogItem read(LogFilter filter)
             throws IOException
指定のフィルターにマッチする次のLogItemを読み出します。

setLogItemBuilder

public void setLogItemBuilder(LogItemBuilder builder)