GATE
Version 3.1-2270

gate.creole.morph
Class ReadFile

java.lang.Object
  extended by gate.creole.morph.ReadFile

public class ReadFile
extends Object

Title: ReadFile.java

Description: This class provides methods to read the file (provided by the user) and to have the read access to each and every line separately


Constructor Summary
ReadFile(URL fileURL)
          Constructor - Initialise the buffered Reader instance
 
Method Summary
 String getNext()
          This method gives the next available String (line from the file)
 int getPointer()
          Tells the position of the pointer in the file
 boolean hasNext()
          This method tells if next line is available to read
 boolean read()
          Reads the file and stores each line as a separate element in the ArrayList
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReadFile

public ReadFile(URL fileURL)
Constructor - Initialise the buffered Reader instance

Parameters:
fileName - Name of the file to be read
Method Detail

read

public boolean read()
Reads the file and stores each line as a separate element in the ArrayList

Returns:
true if read operation is successful, false otherwise

hasNext

public boolean hasNext()
This method tells if next line is available to read

Returns:
true if line is available, false otherwise

getNext

public String getNext()
This method gives the next available String (line from the file)

Returns:
line if available, null otherwise

getPointer

public int getPointer()
Tells the position of the pointer in the file

Returns:
line number where the pointer is located in the file

GATE
Version 3.1-2270