name.angoca.db2sa.core.syntax
Class ImplSyntaxAnalyzer

Package class diagram package ImplSyntaxAnalyzer
java.lang.Object
  extended by name.angoca.db2sa.core.syntax.AbstractSyntacticalAnalyzer
      extended by name.angoca.db2sa.core.syntax.ImplSyntaxAnalyzer

public final class ImplSyntaxAnalyzer
extends AbstractSyntacticalAnalyzer

This is the implementation of the syntax analyzer. This is almost the most important part of the application.
Control Version

Version:
1.0.0 2009-07-19
Author:
Andres Gomez Casanova (AngocA)

Constructor Summary
ImplSyntaxAnalyzer()
          Constructor that sets a token that permits to scan the graph.
 
Method Summary
static void destroyInstance()
          Destroys the instance.
static ImplSyntaxAnalyzer getInstance()
          Implementation of solitaire pattern, that returns the only instance of an object.
 GraphAnswer getOptions(List<Token> phrase)
          Returns the possible options that a given phrase can have.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ImplSyntaxAnalyzer

public ImplSyntaxAnalyzer()
                   throws InvalidGraphException
Constructor that sets a token that permits to scan the graph.

Throws:
InvalidGraphException - When there is a problem when creating the graph.
Method Detail

getInstance

public static ImplSyntaxAnalyzer getInstance()
                                      throws InvalidGraphException
Implementation of solitaire pattern, that returns the only instance of an object.

Returns:
The only instance of this object.
Throws:
InvalidGraphException - When there is a problem at graph creation.

destroyInstance

public static void destroyInstance()
Destroys the instance. Useful for testing purposes.


getOptions

public GraphAnswer getOptions(List<Token> phrase)
                       throws InvalidGraphException
Description copied from class: AbstractSyntacticalAnalyzer
Returns the possible options that a given phrase can have. When no option is found, the returned array is empty (not null).

Specified by:
getOptions in class AbstractSyntacticalAnalyzer
Parameters:
phrase - Phrase to analyze. This is an ensemble of tokens that are sorted in the same way that words were written by the user.
Returns:
The possible answers: the command completed or the options.
Throws:
InvalidGraphException - When the graph has an invalid structure.


Andres Gomez Casanova (AngocA) Creative Commons License
This work is licensed under a Creative Commons Attribution 3.0 Unported License.