jmri.jmrix.loconet.spjfile
Class SpjFile

java.lang.Object
  extended by jmri.jmrix.loconet.spjfile.SpjFile

public class SpjFile
extends Object

Provide tools for reading, writing and accessing Digitrax SPJ files.

Four-byte quantities in SPJ files are little-endian.

Author:
Bob Jacobsen Copyright (C) 2006, 2009

Nested Class Summary
 class SpjFile.Header
          Class representing a header record
 
Constructor Summary
SpjFile(File file)
           
 
Method Summary
 void dispose()
           
 SpjFile.Header findSdfHeader()
           
 String getComment()
           
 SpjFile.Header getHeader(int index)
           
 String getMapEntry(int i)
          Find the map entry (character string) that corresponds to a particular handle number
 int numHeaders()
          Number of headers present in the file.
 void read()
          Read the file whose name was provided earlier
 void save(String name)
          Save this file.
 void writeSubFiles()
          Write data from headers into separate files.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SpjFile

public SpjFile(File file)
Method Detail

numHeaders

public int numHeaders()
Number of headers present in the file.

Returns:
-1 if error

getComment

public String getComment()

getHeader

public SpjFile.Header getHeader(int index)

findSdfHeader

public SpjFile.Header findSdfHeader()

getMapEntry

public String getMapEntry(int i)
Find the map entry (character string) that corresponds to a particular handle number


save

public void save(String name)
          throws IOException
Save this file. It lays the file out again, changing the record start addresses into a sequential series

Throws:
IOException - if anything goes wrong

read

public void read()
          throws IOException
Read the file whose name was provided earlier

Throws:
IOException

writeSubFiles

public void writeSubFiles()
                   throws IOException
Write data from headers into separate files. Normally, we just work with the data within this file. This method allows us to extract the contents of the file for external use.

Throws:
IOException

dispose

public void dispose()


Copyright © 1997 - 2011 JMRI Community.
JMRI, DecoderPro, PanelPro, SoundPro, DispatcherPro and associated logos are our trademarks.

Additional information on copyright, trademarks and licenses is linked here.
Site hosted by: Get JMRI Model Railroad Interface at SourceForge.net. Fast, secure and Free Open Source software downloads