Package jmri.jmrix.loconet.spjfile
Class SpjFile
- java.lang.Object
- 
- jmri.jmrix.loconet.spjfile.SpjFile
 
- 
 public class SpjFile extends java.lang.Object Provide tools for reading, writing and accessing Digitrax SPJ files.Four-byte quantities in SPJ files are little-endian. 
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description (package private) classSpjFile.FirstHeaderClass representing first headerclassSpjFile.HeaderClass representing a header record.
 - 
Field SummaryFields Modifier and Type Field Description (package private) java.io.Filefile(package private) SpjFile.FirstHeaderh0(package private) SpjFile.Header[]headers(package private) java.lang.String[]mapCache
 - 
Constructor SummaryConstructors Constructor Description SpjFile(java.io.File file)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddispose()SpjFile.HeaderfindSdfHeader()java.lang.StringgetComment()SpjFile.HeadergetHeader(int index)java.lang.StringgetMapEntry(int i)Find the map entry (character string) that corresponds to a particular handle number.(package private) voidloadMapCache()intnumHeaders()Number of headers present in the file.voidread()Read the file whose name was provided earlier.voidsave(java.lang.String name)Save this file.(package private) voidwriteSubFile(int i, java.lang.String name)Write the content from a specific header as a new "subfile".voidwriteSubFiles()Write data from headers into separate files.
 
- 
- 
- 
Field Detail- 
mapCachejava.lang.String[] mapCache 
 - 
filejava.io.File file 
 - 
headersSpjFile.Header[] headers 
 
- 
 - 
Constructor Detail- 
SpjFilepublic SpjFile(java.io.File file) 
 
- 
 - 
Method Detail- 
numHeaderspublic int numHeaders() Number of headers present in the file.- Returns:
- -1 if error
 
 - 
getCommentpublic java.lang.String getComment() 
 - 
getHeaderpublic SpjFile.Header getHeader(int index) 
 - 
findSdfHeaderpublic SpjFile.Header findSdfHeader() 
 - 
getMapEntrypublic java.lang.String getMapEntry(int i) Find the map entry (character string) that corresponds to a particular handle number.- Parameters:
- i- handle index.
- Returns:
- string of map entry.
 
 - 
loadMapCachevoid loadMapCache() 
 - 
savepublic void save(java.lang.String name) throws java.io.IOException Save this file.It lays the file out again, changing the record start addresses into a sequential series. - Parameters:
- name- file name.
- Throws:
- java.io.IOException- if anything goes wrong
 
 - 
readpublic void read() throws java.io.IOException Read the file whose name was provided earlier.- Throws:
- java.io.IOException- on file error.
 
 - 
writeSubFilespublic void writeSubFiles() throws java.io.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:
- java.io.IOException- on file error.
 
 - 
writeSubFilevoid writeSubFile(int i, java.lang.String name) throws java.io.IOException Write the content from a specific header as a new "subfile".- Parameters:
- i- index of the specific header
- name- filename
- Throws:
- java.io.IOException- based on underlying activity
 
 - 
disposepublic void dispose() 
 
- 
 
-