org.sat4j.reader
Class EfficientScanner

java.lang.Object
  extended by org.sat4j.reader.EfficientScanner
All Implemented Interfaces:
Serializable

public class EfficientScanner
extends Object
implements Serializable

Efficient scanner based on the LecteurDimacs class written by Frederic Laihem. It is much faster than Java Scanner class because it does not split the input file into strings but reads and interpret the input char by char. Furthermore, it is based on stream (char in ASCII) and not reader (word in UTF).

Since:
2.1
Author:
laihem, leberre
See Also:
Serialized Form

Constructor Summary
EfficientScanner(InputStream input)
           
EfficientScanner(InputStream input, char commentChar)
           
 
Method Summary
 void close()
           
 char currentChar()
           
 boolean eof()
           
 String next()
           
 BigInteger nextBigInteger()
           
 int nextInt()
          To get the next available integer.
 String nextLine()
           
 void skipComments()
          Skip commented lines.
 void skipRestOfLine()
           
 char skipSpaces()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EfficientScanner

public EfficientScanner(InputStream input,
                        char commentChar)

EfficientScanner

public EfficientScanner(InputStream input)
Method Detail

close

public void close()
           throws IOException
Throws:
IOException

skipComments

public void skipComments()
                  throws IOException
Skip commented lines.

Throws:
IOException

nextInt

public int nextInt()
            throws IOException,
                   ParseFormatException
To get the next available integer.

Returns:
Throws:
IOException
ParseFormatException

nextBigInteger

public BigInteger nextBigInteger()
                          throws IOException,
                                 ParseFormatException
Throws:
IOException
ParseFormatException

next

public String next()
            throws IOException,
                   ParseFormatException
Throws:
ParseFormatException - never used in that method.
IOException

skipSpaces

public char skipSpaces()
                throws IOException
Throws:
IOException

nextLine

public String nextLine()
                throws IOException
Throws:
IOException

skipRestOfLine

public void skipRestOfLine()
                    throws IOException
Throws:
IOException

eof

public boolean eof()
            throws IOException
Throws:
IOException

currentChar

public char currentChar()
                 throws IOException
Throws:
IOException


Copyright © 2012 Centre de Recherche en Informatique de Lens (CRIL). All Rights Reserved.