edu.upc.dama.dex.shell
Class Shell

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

public class Shell
extends java.lang.Object
implements edu.upc.dama.dex.shell.ShellConstants

Author:
Sparsity Technologies

Field Summary
 edu.upc.dama.dex.shell.Token jj_nt
           
 edu.upc.dama.dex.shell.Token token
           
 edu.upc.dama.dex.shell.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(edu.upc.dama.dex.shell.ShellTokenManager tm)
           
 
Method Summary
 void close()
          Close the shell
 void disable_tracing()
           
 void enable_tracing()
           
 void execute()
           
 edu.upc.dama.dex.shell.ParseException generateParseException()
           
 edu.upc.dama.dex.shell.Token getNextToken()
           
 edu.upc.dama.dex.shell.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(edu.upc.dama.dex.shell.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 edu.upc.dama.dex.shell.ShellTokenManager token_source

token

public edu.upc.dama.dex.shell.Token token

jj_nt

public edu.upc.dama.dex.shell.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(edu.upc.dama.dex.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 edu.upc.dama.dex.shell.ParseException,
                       java.lang.NumberFormatException,
                       java.io.IOException
Throws:
edu.upc.dama.dex.shell.ParseException
java.lang.NumberFormatException
java.io.IOException

startConsole

public final int startConsole()
                       throws edu.upc.dama.dex.shell.ParseException,
                              java.lang.NumberFormatException,
                              java.io.IOException
Throws:
edu.upc.dama.dex.shell.ParseException
java.lang.NumberFormatException
java.io.IOException

runCommand

public final void runCommand(java.io.Reader reader)
                      throws edu.upc.dama.dex.shell.ParseException,
                             java.lang.NumberFormatException,
                             java.io.IOException
Throws:
edu.upc.dama.dex.shell.ParseException
java.lang.NumberFormatException
java.io.IOException

execute

public final void execute()
                   throws edu.upc.dama.dex.shell.ParseException,
                          java.lang.NumberFormatException,
                          java.io.IOException
Throws:
edu.upc.dama.dex.shell.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(edu.upc.dama.dex.shell.ShellTokenManager tm)

getNextToken

public final edu.upc.dama.dex.shell.Token getNextToken()

getToken

public final edu.upc.dama.dex.shell.Token getToken(int index)

generateParseException

public edu.upc.dama.dex.shell.ParseException generateParseException()

enable_tracing

public final void enable_tracing()

disable_tracing

public final void disable_tracing()