simulations.core.history
Class HistoryReader

java.lang.Object
  extended by simulations.core.history.HistoryReader

public class HistoryReader
extends java.lang.Object

This class describes the reader of the history of a game


Constructor Summary
HistoryReader(java.io.File file)
          Creates a new instance of HistoryReader
 
Method Summary
 void close()
          close the history file
 java.io.File getFile()
          Getter for property file.
 int getOffset()
          Getter for property offset.
 java.lang.String next100LinesFrom(int offset)
          Return the next 100 lines after offset*100 lines of the game
 java.lang.String nextKo()
          Return the next Ko of the file
 java.lang.String nextLine()
          Return the next line of the history file
 java.lang.String read()
          read the history file
 void setFile(java.io.File file)
          Setter for property file.
 void setOffset(int offset)
          Setter for property offset.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HistoryReader

public HistoryReader(java.io.File file)
              throws java.io.FileNotFoundException
Creates a new instance of HistoryReader

Parameters:
file - the history file
Throws:
java.io.FileNotFoundException - if the file doesn't exist
Method Detail

read

public java.lang.String read()
                      throws java.io.IOException
read the history file

Returns:
The history file in a String
Throws:
java.io.IOException - if the file doesn't exist

nextLine

public java.lang.String nextLine()
                          throws java.io.IOException
Return the next line of the history file

Returns:
Return the next line of the history file
Throws:
java.io.IOException - Return an IOException in case of problem

next100LinesFrom

public java.lang.String next100LinesFrom(int offset)
                                  throws java.io.IOException
Return the next 100 lines after offset*100 lines of the game

Parameters:
offset - The offset
Returns:
A String containing the 100 lines after the offset*100 lines of the history file
Throws:
java.io.IOException - Return an IOException in case of problem

nextKo

public java.lang.String nextKo()
                        throws java.io.IOException
Return the next Ko of the file

Returns:
Return the next Ko of the file
Throws:
java.io.IOException - Return an IOException in case of problem

close

public void close()
           throws java.io.IOException
close the history file

Throws:
java.io.IOException - Return an IOException in case of problem

getFile

public java.io.File getFile()
Getter for property file.

Returns:
Value of property file.

setFile

public void setFile(java.io.File file)
Setter for property file.

Parameters:
file - New value of property file.

getOffset

public int getOffset()
Getter for property offset.

Returns:
Value of property offset.

setOffset

public void setOffset(int offset)
Setter for property offset.

Parameters:
offset - New value of property offset.