edu.upc.dama.dex.shell
Class Shell

java.lang.Object
  extended by edu.upc.dama.dex.shell.Shell
All Implemented Interfaces:
ShellConstants

public class Shell
extends java.lang.Object
implements ShellConstants

Author:
Sparsity Technologies

Field Summary
 Token jj_nt
           
 Token token
           
 ShellTokenManager token_source
           
 
Fields inherited from interface edu.upc.dama.dex.shell.ShellConstants
ATTRCOUNT, ATTRIBUTES, ATTRSIZE, BOTH, CLOSEPAR, COUNT, DATA, DEFAULT, DIGITS, DIV, DOUBLE, DOUBLEPOS, DUMP, EDGES, EOF, EOL, EQ, ERE, EXPLODE, EXTRA, FALSE, FATTR, FATTRS, FEDGE, FEDGES, FINDTYPE, FOBJECT, GATTR, GATTRS, GE, GEDGEPEER, GET, GLOBALS, GT, HEAD, HEADS, HELP, IDENT, ILIKE, IN, LE, LETTER, LIKE, LONG, LT, MINUS, MUL, NE, NEIGH, NO, NODES, NULL, NUMBER, OBJECT, OFF, ON, OPENPAR, OUT, PLUS, PRINT, QUIT, SCHEMA, SELECT, SET, STORAGE, STRING, TAIL, TAILS, tokenImage, TRUE, TYPE, TYPES, YES
 
Constructor Summary
Shell(DbGraph dbgraph, java.io.Reader reader, java.io.Writer writer)
          Create a new shell.
Shell(java.io.InputStream stream)
           
Shell(java.io.InputStream stream, java.lang.String encoding)
           
Shell(java.io.Reader stream)
           
Shell(ShellTokenManager tm)
           
 
Method Summary
 void close()
          Close the shell
 void disable_tracing()
           
 void enable_tracing()
           
 void execute()
           
 ParseException generateParseException()
           
 Token getNextToken()
           
 Token getToken(int index)
           
static void main(java.lang.String[] args)
          Command-line tool to interact with an existing graph database.
 void ReInit(java.io.InputStream stream)
           
 void ReInit(java.io.InputStream stream, java.lang.String encoding)
           
 void ReInit(java.io.Reader stream)
           
 void ReInit(ShellTokenManager tm)
           
 void runCommand(java.io.Reader reader)
           
 int start()
           
 int startConsole()
           
 void stopCommand()
          Stop the execution of the current command.
 void work()
          Mark the shell as working.
 boolean workToDo()
          Getter to know if the shell is busy.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

token_source

public ShellTokenManager token_source

token

public Token token

jj_nt

public Token jj_nt
Constructor Detail

Shell

public Shell(DbGraph dbgraph,
             java.io.Reader reader,
             java.io.Writer writer)
      throws java.io.IOException
Create a new shell.

Parameters:
dbgraph - DbGraph used for the shell to execute the commands.
reader - Reader used for the shell to read the input commands.
writer - Writer used for the shell to write the commands results.
Throws:
java.io.IOException - If bad things happen during the construction of the communication with the shell.

Shell

public Shell(java.io.InputStream stream)

Shell

public Shell(java.io.InputStream stream,
             java.lang.String encoding)

Shell

public Shell(java.io.Reader stream)

Shell

public Shell(ShellTokenManager tm)
Method Detail

workToDo

public boolean workToDo()
Getter to know if the shell is busy.

Returns:
Return True if ther shell is busy executing any command.

stopCommand

public void stopCommand()
Stop the execution of the current command.


work

public void work()
Mark the shell as working.


close

public void close()
           throws java.io.IOException
Close the shell

Throws:
java.io.IOException - If bad things happen during close

main

public static void main(java.lang.String[] args)
Command-line tool to interact with an existing graph database.

Parameters:
args - 1-length array. First argument is the path of a DEX graph database.

start

public final int start()
                throws ParseException,
                       java.lang.NumberFormatException,
                       java.io.IOException
Throws:
ParseException
java.lang.NumberFormatException
java.io.IOException

startConsole

public final int startConsole()
                       throws ParseException,
                              java.lang.NumberFormatException,
                              java.io.IOException
Throws:
ParseException
java.lang.NumberFormatException
java.io.IOException

runCommand

public final void runCommand(java.io.Reader reader)
                      throws ParseException,
                             java.lang.NumberFormatException,
                             java.io.IOException
Throws:
ParseException
java.lang.NumberFormatException
java.io.IOException

execute

public final void execute()
                   throws ParseException,
                          java.lang.NumberFormatException,
                          java.io.IOException
Throws:
ParseException
java.lang.NumberFormatException
java.io.IOException

ReInit

public void ReInit(java.io.InputStream stream)

ReInit

public void ReInit(java.io.InputStream stream,
                   java.lang.String encoding)

ReInit

public void ReInit(java.io.Reader stream)

ReInit

public void ReInit(ShellTokenManager tm)

getNextToken

public final Token getNextToken()

getToken

public final Token getToken(int index)

generateParseException

public ParseException generateParseException()

enable_tracing

public final void enable_tracing()

disable_tracing

public final void disable_tracing()