cds.astro
Class ParsingText

java.lang.Object
  extended bycds.astro.ParsingText

class ParsingText
extends java.lang.Object

This internal class for parsing text. It just saves the text as an array, keeping the current position in the text.


Field Summary
 char[] a
           
 int len
           
 int pos
           
 
Constructor Summary
ParsingText(java.lang.String s)
           
 
Method Summary
 void advance(int n)
           
 int lookup(java.lang.String[] tSymbol)
          Try to match the current text to a Symbol from a List of Symbols
 int lookup(java.lang.String[] tSymbol, int len)
          Try to match the current text to a Symbol from a List
 double parseFactor()
          Interpret a real number as (+/-)numx10+pow
 int parseInt()
          Try to match an Integer Number
 double parseSexa()
          Interpret a sexagesimal number
 void set(int n)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

a

public char[] a

len

public int len

pos

public int pos
Constructor Detail

ParsingText

public ParsingText(java.lang.String s)
Method Detail

set

public final void set(int n)

advance

public final void advance(int n)

toString

public final java.lang.String toString()

lookup

public final int lookup(java.lang.String[] tSymbol,
                        int len)
Try to match the current text to a Symbol from a List

Parameters:
tSymbol - table of Symbols
len - exact length of text to match
Returns:
the index in table of Symbols (-1 if not found)

lookup

public final int lookup(java.lang.String[] tSymbol)
Try to match the current text to a Symbol from a List of Symbols

Parameters:
tSymbol - a table of Symbols
Returns:
the index in table of Symbols (-1 if not found)

parseInt

public final int parseInt()
Try to match an Integer Number

Returns:
the integer read -- 1 by default.

parseFactor

public final double parseFactor()
Interpret a real number as (+/-)numx10+pow

Returns:
the double which could be interpreted -- 1 by default.

parseSexa

public final double parseSexa()
Interpret a sexagesimal number

Returns:
as a double what can be interpreted -- 1 by default.