choco.cp.solver.constraints.global.geost.util
Class InputParser

java.lang.Object
  extended by choco.cp.solver.constraints.global.geost.util.InputParser

public final class InputParser
extends Object

This class parses a text file that describes the problem to be solved. While parsing it creates the choco problem, the objects, shapes and shifted boxes and stores them locally to this class. Then to create the environment that the constraint uses all we need to do is call global.Setup.createEnvironment(parser) and give it this object as an argument.


Nested Class Summary
static class InputParser.GeostProblem
           
 
Field Summary
protected static Logger LOGGER
           
 
Constructor Summary
InputParser()
           
InputParser(InputParser.GeostProblem gp, int dim)
           
InputParser(String path, int dim)
           
 
Method Summary
 List<GeostObject> getObjects()
           
 List<Shape> getShapes()
           
 List<ShiftedBox> getShiftedBoxes()
           
 boolean parse()
           
 boolean parseFile()
          This is the essential function of this class it.
 boolean parseGP()
          This is the essential function of this class it.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOGGER

protected static final Logger LOGGER
Constructor Detail

InputParser

public InputParser()

InputParser

public InputParser(String path,
                   int dim)

InputParser

public InputParser(InputParser.GeostProblem gp,
                   int dim)
Method Detail

getObjects

public List<GeostObject> getObjects()

getShapes

public List<Shape> getShapes()

getShiftedBoxes

public List<ShiftedBox> getShiftedBoxes()

parse

public boolean parse()
              throws IOException
Throws:
IOException

parseFile

public boolean parseFile()
                  throws IOException
This is the essential function of this class it. It is the function that executes the parsing. The file to be parsed is read from the local variable path. The value of path is given to the constructor as parameter.

Returns:
The function returns false if there was an error during the parsing otherwise it returns true.
Throws:
IOException

parseGP

public boolean parseGP()
This is the essential function of this class it. It is the function that executes the parsing. Lists to be parsed are read.

Returns:
The function returns false if there was an error during the parsing otherwise it returns true.


Copyright © 2012. All Rights Reserved.