Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## Class s2iDBReadWrite

    java.lang.Object
      |
      +--s2iDBReadWrite

public class s2iDBReadWrite
extends java.lang.Object

A class for reading and writing the SpiTran project files. This also calls registered listeners that need to load additional data files for the project.

Author:
  Anish Malhotra, Cadence Design Systems
See Also:
  `s2iDBOpenListener`

Field Summary
`(package private) static java.util.Vector` | `s2iDBOpenListeners` List of registered DB open listeners

Constructor Summary
`s2iDBReadWrite()`

Method Summary
`static void` | `addDBOpenListener(s2iDBOpenListener l)` Register a DB open listener to be called on DB open.
`private static void` | `fillVector(java.util.Vector v1, java.io.BufferedReader fileBuf, java.lang.String endToken)` Fill a Vector with lines from a file until a line beginning with a particular token is seen.
`static void` | `fireDBOpenEvent()` Call the getDB() methods of the registered DB open listeners.
`static void` | `fireDBSaveEvent()` Save data other than the project file.
`private static boolean` | `isVersionOK(java.lang.String token, java.util.StringTokenizer tokenizer)` Determine if the version of a SpiTran project file matches the current version.
`static void` | `readDBfromFile(java.lang.String fileName)` Read data from a SpiTran project file.
`static void` | `removeDBOpenListener(s2iDBOpenListener l)` Unregister a DB open listener.
`static void` | `writeDBtoFile()` Save project data to the project file.

Methods inherited from class java.lang.Object
`, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait`

Field Detail

### s2iDBOpenListeners

    static java.util.Vector s2iDBOpenListeners

  List of registered DB open listeners
  See Also:
    `s2iDBOpenListener`

Constructor Detail

### s2iDBReadWrite

    public s2iDBReadWrite()

Method Detail

### addDBOpenListener

    public static void addDBOpenListener(s2iDBOpenListener l)

  Register a DB open listener to be called on DB open.
  See Also:
    `s2iDBOpenListener`

### removeDBOpenListener

    public static void removeDBOpenListener(s2iDBOpenListener l)

  Unregister a DB open listener.
  See Also:
    `s2iDBOpenListener`

### fireDBOpenEvent

    public static void fireDBOpenEvent()

  Call the getDB() methods of the registered DB open listeners.
  See Also:
    `s2iDBOpenListener`

### writeDBtoFile

    public static void writeDBtoFile()

  Save project data to the project file.

### isVersionOK

    private static boolean isVersionOK(java.lang.String token,
                                       java.util.StringTokenizer tokenizer)

  Determine if the version of a SpiTran project file matches the current version. This should be called after reading a "Version" token from the file. It will consume tokens until the version is known. Nothing is printed if version matching fails.
  Parameters:
    `token` - The "Version" token String.
    `tokenizer` - A StringTokenizer for reading more tokens.
  Returns:
    true if the version is correct.

### fillVector

    private static void fillVector(java.util.Vector v1,
                                   java.io.BufferedReader fileBuf,
                                   java.lang.String endToken)

  Fill a Vector with lines from a file until a line beginning with a particular token is seen.
  Parameters:
    `vl` - The Vector to fill with line Strings.
    `fileBuf` - A BufferedReader for reading lines from the file.
    `endToken` - The token String that signifies end of data.

### readDBfromFile

    public static void readDBfromFile(java.lang.String fileName)

  Read data from a SpiTran project file. Data is stored on the static field members in s2iGlobals.
  Parameters:
    `fileName` - The path String of the project file to read.
  See Also:
    `s2iGlobals`

### fireDBSaveEvent

    public static void fireDBSaveEvent()

  Save data other than the project file. This complements the fireDBOpenEvent() method. Currently this does nothing.

Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD