fr.esrf.tangoatk.widget.util.chart
Class CfFileReader

java.lang.Object
  extended by fr.esrf.tangoatk.widget.util.chart.CfFileReader

public class CfFileReader
extends java.lang.Object

A class to parse configuration file


Nested Class Summary
protected  class CfFileReader.Item
           
 
Field Summary
protected  java.lang.String cfStr
           
protected  char currentChar
           
protected  java.io.FileReader file
           
protected  java.util.Vector<CfFileReader.Item> prop
           
protected  java.io.BufferedReader stream
           
 
Constructor Summary
CfFileReader()
           
 
Method Summary
protected  boolean eof()
           
protected  char getCurrentChar()
           
 java.util.Vector<java.lang.String> getNames()
          Return all parameter names found in the config file.
 java.util.Vector<java.lang.String> getParam(java.lang.String name)
          Return parameter value, one parameter can have multiple fields seperated by a colon.
static void main(java.lang.String[] args)
           
protected  boolean parse()
           
 boolean parseText(java.lang.String text)
          Parse the given string and fill property vector.
 boolean readFile(java.io.File file)
          Parse the given file and fill property vector.
 boolean readFile(java.lang.String filename)
          Parse the given file and fill property vector.
 boolean readStream(java.io.BufferedReader stream)
           
protected  java.lang.String readWord()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

prop

protected java.util.Vector<CfFileReader.Item> prop

file

protected java.io.FileReader file

cfStr

protected java.lang.String cfStr

currentChar

protected char currentChar

stream

protected java.io.BufferedReader stream
Constructor Detail

CfFileReader

public CfFileReader()
Method Detail

getCurrentChar

protected char getCurrentChar()
                       throws java.io.IOException
Throws:
java.io.IOException

eof

protected boolean eof()
               throws java.io.IOException
Throws:
java.io.IOException

readWord

protected java.lang.String readWord()
                             throws java.io.IOException
Throws:
java.io.IOException

parse

protected boolean parse()
                 throws java.io.IOException
Throws:
java.io.IOException

parseText

public boolean parseText(java.lang.String text)
Parse the given string and fill property vector.

Parameters:
text - String containing text to parse
Returns:
Return true when text succesfully parsed

readFile

public boolean readFile(java.lang.String filename)
Parse the given file and fill property vector.

Parameters:
filename - File to parse
Returns:
Return true when file succesfully parsed

readFile

public boolean readFile(java.io.File file)
Parse the given file and fill property vector.

Parameters:
filename - File to parse
Returns:
Return true when file succesfully parsed

readStream

public boolean readStream(java.io.BufferedReader stream)

getNames

public java.util.Vector<java.lang.String> getNames()
Return all parameter names found in the config file.

Returns:
Returns a vector of String.

getParam

public java.util.Vector<java.lang.String> getParam(java.lang.String name)
Return parameter value, one parameter can have multiple fields seperated by a colon.

Parameters:
name - Parameter name
Returns:
Returns a vector of String. (1 string per field)

main

public static void main(java.lang.String[] args)