Package jmri.jmrix.loconet.spjfile
Class SpjFile
java.lang.Object
jmri.jmrix.loconet.spjfile.SpjFile
Provide tools for reading, writing and accessing Digitrax SPJ files.
Four-byte quantities in SPJ files are little-endian.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) classClass representing first headerclassClass representing a header record. -
Field Summary
FieldsModifier and TypeFieldDescription(package private) File(package private) SpjFile.FirstHeader(package private) SpjFile.Header[](package private) String[] -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddispose()getHeader(int index) getMapEntry(int i) Find the map entry (character string) that corresponds to a particular handle number.(package private) voidintNumber of headers present in the file.voidread()Read the file whose name was provided earlier.voidSave this file.(package private) voidwriteSubFile(int i, String name) Write the content from a specific header as a new "subfile".voidWrite data from headers into separate files.
-
Field Details
-
mapCache
-
file
-
h0
-
headers
-
-
Constructor Details
-
SpjFile
-
-
Method Details
-
numHeaders
Number of headers present in the file.- Returns:
- -1 if error
-
getComment
-
getHeader
-
findSdfHeader
-
getMapEntry
Find the map entry (character string) that corresponds to a particular handle number.- Parameters:
i- handle index.- Returns:
- string of map entry.
-
loadMapCache
void loadMapCache() -
save
Save this file.It lays the file out again, changing the record start addresses into a sequential series.
- Parameters:
name- file name.- Throws:
IOException- if anything goes wrong
-
read
Read the file whose name was provided earlier.- Throws:
IOException- on file error.
-
writeSubFiles
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- on file error.
-
writeSubFile
Write the content from a specific header as a new "subfile".- Parameters:
i- index of the specific headername- filename- Throws:
IOException- based on underlying activity
-
dispose
-