ElegantJ Data Tables Java API Specification v1.1

com.elegantj.data.parser
Class Scanner

java.lang.Object
  extended bycom.elegantj.data.parser.Scanner
All Implemented Interfaces:
com.elegantj.data.parser.SharedConstants

public class Scanner
extends java.lang.Object
implements com.elegantj.data.parser.SharedConstants

The Scanner class represents the functionality of the scanning the buffer to get tokens.


Field Summary
static int maxSymLen
          Specifies the maximum symbol length
static java.lang.String[] sharedCharacters
          Specifies the shared characters that can be scanned
static java.lang.String[] sharedOperators
          Specifies the shared operators that can be scanned
static int stError
          A constant used for representing the scanning error status
static int stOk
          A constant used for representing the scanning ok status
static int stQuit
          A constant used for representing the scanning quit status
static int tAnd
          A constant used for representing the logical and operation
static int tAssign
          A constant used for representing the assigning operation
static int tCharacter
          A constant used for representing the character
static int tCom
          A constant used for representing the arguments in the symbolic operation
static int tDivide
          A constant used for representing the dividing operation
static int tDouble
          A constant used for representing the double
static int tEnd
          A constant used for representing the scanning end status
static int tEqual
          A constant used for representing the equal to operator in the comparing operation
static int tError
          A constant used for representing the scanning error status
static int tGreater
          A constant used for representing the greater then operator in the comparing operation
static int tGreaterEqual
          A constant used for representing the greater then or equals to operator in the comparing operation
static int tIdent
          A constant used for representing the symbolic operation
static int tInteger
          A constant used for representing the integer
static int tLess
          A constant used for representing the less then operator in the comparing operation
static int tLessEqual
          A constant used for representing the less then or equal to operator in the comparing operation
static int tLParen
          A constant used for representing the left parenthesis
static int tMinus
          A constant used for representing the substracting operation
static int tMult
          A constant used for representing the multiplying operation
static int tNotEqual
          A constant used for representing the not equal to operator in the comparing operation
static int tOr
          A constant used for representing the logical or operation
static int tPlus
          A constant used for representing the adding operation
static int tPow
          A constant used for representing the powering operation
static int tRParen
          A constant used for representing the right parenthesis
static int tStart
          A constant used for representing the scanning start status
static int tString
          A constant used for representing the string
 
Constructor Summary
Scanner()
           
Scanner(java.lang.String buf_in)
          Creates a Scanner with specified buffer for scanning
 
Method Summary
 int accept()
          Determines whether the buffer are acceptable or not, if acceptable it will scan the buffer and return the valid token
 void eatCharacter()
          Scans the character
 char getCharacter()
          Returns the character token
 double getDouble()
          Returns the double token
 int getInteger()
          Returns the integer token
 int getPosition()
          Returns the current pointer of the scanner
 java.lang.String getString()
          Returns the string token
 java.lang.String getSymbolName()
          Returns the symbol name
 int getToken()
          Returns the current token type
 void reset()
          Resets the scanning
 void scanBuffer()
          Scans the buffer
 void setBuffer(java.lang.String buf_in)
          Sets the string buffer for scanning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

sharedOperators

public static final java.lang.String[] sharedOperators
Specifies the shared operators that can be scanned


sharedCharacters

public static final java.lang.String[] sharedCharacters
Specifies the shared characters that can be scanned


maxSymLen

public static final int maxSymLen
Specifies the maximum symbol length

See Also:
Constant Field Values

stOk

public static final int stOk
A constant used for representing the scanning ok status

See Also:
Constant Field Values

stQuit

public static final int stQuit
A constant used for representing the scanning quit status

See Also:
Constant Field Values

stError

public static final int stError
A constant used for representing the scanning error status

See Also:
Constant Field Values

tStart

public static final int tStart
A constant used for representing the scanning start status

See Also:
Constant Field Values

tEnd

public static final int tEnd
A constant used for representing the scanning end status

See Also:
Constant Field Values

tError

public static final int tError
A constant used for representing the scanning error status

See Also:
Constant Field Values

tPlus

public static final int tPlus
A constant used for representing the adding operation

See Also:
Constant Field Values

tMult

public static final int tMult
A constant used for representing the multiplying operation

See Also:
Constant Field Values

tDivide

public static final int tDivide
A constant used for representing the dividing operation

See Also:
Constant Field Values

tMinus

public static final int tMinus
A constant used for representing the substracting operation

See Also:
Constant Field Values

tLParen

public static final int tLParen
A constant used for representing the left parenthesis

See Also:
Constant Field Values

tRParen

public static final int tRParen
A constant used for representing the right parenthesis

See Also:
Constant Field Values

tAssign

public static final int tAssign
A constant used for representing the assigning operation

See Also:
Constant Field Values

tPow

public static final int tPow
A constant used for representing the powering operation

See Also:
Constant Field Values

tIdent

public static final int tIdent
A constant used for representing the symbolic operation

See Also:
Constant Field Values

tCom

public static final int tCom
A constant used for representing the arguments in the symbolic operation

See Also:
Constant Field Values

tAnd

public static final int tAnd
A constant used for representing the logical and operation

See Also:
Constant Field Values

tOr

public static final int tOr
A constant used for representing the logical or operation

See Also:
Constant Field Values

tLess

public static final int tLess
A constant used for representing the less then operator in the comparing operation

See Also:
Constant Field Values

tGreater

public static final int tGreater
A constant used for representing the greater then operator in the comparing operation

See Also:
Constant Field Values

tLessEqual

public static final int tLessEqual
A constant used for representing the less then or equal to operator in the comparing operation

See Also:
Constant Field Values

tGreaterEqual

public static final int tGreaterEqual
A constant used for representing the greater then or equals to operator in the comparing operation

See Also:
Constant Field Values

tNotEqual

public static final int tNotEqual
A constant used for representing the not equal to operator in the comparing operation

See Also:
Constant Field Values

tEqual

public static final int tEqual
A constant used for representing the equal to operator in the comparing operation

See Also:
Constant Field Values

tInteger

public static final int tInteger
A constant used for representing the integer

See Also:
Constant Field Values

tDouble

public static final int tDouble
A constant used for representing the double

See Also:
Constant Field Values

tCharacter

public static final int tCharacter
A constant used for representing the character

See Also:
Constant Field Values

tString

public static final int tString
A constant used for representing the string

See Also:
Constant Field Values
Constructor Detail

Scanner

public Scanner()

Scanner

public Scanner(java.lang.String buf_in)
Creates a Scanner with specified buffer for scanning

Parameters:
buf_in - the string buffer to be scanned, default ""
Method Detail

setBuffer

public void setBuffer(java.lang.String buf_in)
Sets the string buffer for scanning

Parameters:
buf_in - the string buffer to be scanned

reset

public void reset()
Resets the scanning


scanBuffer

public void scanBuffer()
Scans the buffer


getToken

public int getToken()
Returns the current token type

Returns:
an integer representing the current token type

getPosition

public int getPosition()
Returns the current pointer of the scanner

Returns:
an integer representing the scanner pointer

getInteger

public int getInteger()
Returns the integer token

Returns:
an integer value representing the recently scanned token

getDouble

public double getDouble()
Returns the double token

Returns:
a double value representing the recently scanned token

getString

public java.lang.String getString()
Returns the string token

Returns:
a string value representing the recently scanned token

getCharacter

public char getCharacter()
Returns the character token

Returns:
a character value representing the recently scanned token

getSymbolName

public java.lang.String getSymbolName()
Returns the symbol name

Returns:
a symbol name representing the recently scanned token

eatCharacter

public void eatCharacter()
Scans the character


accept

public int accept()
Determines whether the buffer are acceptable or not, if acceptable it will scan the buffer and return the valid token

Returns:
an integer representing the recently scanned token

ElegantJ Data Tables Java API Specification v1.1

Submit a bug or feature

Copyright(c)
Elegant Microweb Technologies Pvt. Ltd.
www.elegantmicroweb.com
www.elegantjbeans.com
All Rights Reserved.