org.gamenet.application.mm8leveleditor.lod
Class LodEntry

java.lang.Object
  extended byorg.gamenet.application.mm8leveleditor.lod.LodEntry
All Implemented Interfaces:
Comparable, LodResource
Direct Known Subclasses:
EnglishDLodEntry, MM6LodEntry, MM6NewLodEntry, MM6SndEntry, MM6SpritesLodEntry, MM6VidEntry, MM7NewLodEntry

public abstract class LodEntry
extends Object
implements LodResource, Comparable

Author:
mlk

Field Summary
protected  byte[] dataHeader
           
protected  byte[] entryHeader
           
protected  long entryOffset
           
protected  LodFile lodFile
           
 
Constructor Summary
LodEntry()
           
LodEntry(LodFile lodFile, long entryOffset)
           
 
Method Summary
 int compareTo(Object obj)
           
protected abstract  void computeDataBasedOffsets()
           
protected abstract  void computeEntryBasedOffsets()
           
protected  void computeFileBasedOffsets()
           
 byte[] getDataHeader()
           
protected abstract  long getDataHeaderOffset()
           
protected abstract  int getDataLength()
           
abstract  String getDataName()
           
abstract  long getDataOffset()
           
 byte[] getEntryHeader()
           
abstract  String getEntryName()
           
 long getEntryOffset()
           
abstract  String getFileName()
           
 FormatConverter getFormatConverter()
           
 String getFormatConverterFileType()
           
 LodFile getLodFile()
           
 String getName()
           
protected  void readDataHeader()
           
protected  void readEntryHeader()
           
protected  byte[] readRawData()
           
abstract  long rewriteData(OutputStream outputStream, long dataOffset)
           
abstract  long rewriteEntry(OutputStream outputStream, long entryListOffset, long entryOffset, long dataOffset)
           
abstract  long updateData(LodResource lodResourceDataSource, OutputStream outputStream, long dataOffset)
           
abstract  long updateEntry(LodResource lodResourceDataSource, OutputStream outputStream, long entryListOffset, long entryOffset, long dataOffset)
           
abstract  long writeNewData(LodResource lodResourceDataSource, OutputStream outputStream, long dataOffset)
           
abstract  long writeNewEntry(LodResource lodResourceDataSource, OutputStream outputStream, long entryListOffset, long entryOffset, long dataOffset)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.gamenet.application.mm8leveleditor.lod.LodResource
getData, getResourceType, getTextDescription
 

Field Detail

lodFile

protected LodFile lodFile

entryOffset

protected long entryOffset

entryHeader

protected byte[] entryHeader

dataHeader

protected byte[] dataHeader
Constructor Detail

LodEntry

public LodEntry()

LodEntry

public LodEntry(LodFile lodFile,
                long entryOffset)
         throws IOException
Method Detail

getLodFile

public LodFile getLodFile()

computeFileBasedOffsets

protected void computeFileBasedOffsets()

readEntryHeader

protected void readEntryHeader()
                        throws IOException
Throws:
IOException

readDataHeader

protected void readDataHeader()
                       throws IOException
Throws:
IOException

readRawData

protected byte[] readRawData()
                      throws IOException
Throws:
IOException

computeEntryBasedOffsets

protected abstract void computeEntryBasedOffsets()

computeDataBasedOffsets

protected abstract void computeDataBasedOffsets()

getDataLength

protected abstract int getDataLength()

getDataHeaderOffset

protected abstract long getDataHeaderOffset()

getFormatConverter

public FormatConverter getFormatConverter()

getFormatConverterFileType

public String getFormatConverterFileType()

compareTo

public int compareTo(Object obj)
Specified by:
compareTo in interface Comparable

getEntryName

public abstract String getEntryName()

getDataName

public abstract String getDataName()

getDataOffset

public abstract long getDataOffset()

getEntryOffset

public long getEntryOffset()

getName

public String getName()
Specified by:
getName in interface LodResource

getEntryHeader

public byte[] getEntryHeader()

getDataHeader

public byte[] getDataHeader()
Specified by:
getDataHeader in interface LodResource

getFileName

public abstract String getFileName()

writeNewEntry

public abstract long writeNewEntry(LodResource lodResourceDataSource,
                                   OutputStream outputStream,
                                   long entryListOffset,
                                   long entryOffset,
                                   long dataOffset)
                            throws IOException
Parameters:
outputStream -
entryOffset - to start writing the entry
dataOffset - to start writing the data for this entry
Returns:
dataOffset for next entry
Throws:
IOException

updateEntry

public abstract long updateEntry(LodResource lodResourceDataSource,
                                 OutputStream outputStream,
                                 long entryListOffset,
                                 long entryOffset,
                                 long dataOffset)
                          throws IOException
Throws:
IOException

rewriteEntry

public abstract long rewriteEntry(OutputStream outputStream,
                                  long entryListOffset,
                                  long entryOffset,
                                  long dataOffset)
                           throws IOException
Throws:
IOException

writeNewData

public abstract long writeNewData(LodResource lodResourceDataSource,
                                  OutputStream outputStream,
                                  long dataOffset)
                           throws IOException
Parameters:
outputStream -
dataOffset - to start writing this datum
Returns:
dataOffset for next datum
Throws:
IOException

updateData

public abstract long updateData(LodResource lodResourceDataSource,
                                OutputStream outputStream,
                                long dataOffset)
                         throws IOException
Throws:
IOException

rewriteData

public abstract long rewriteData(OutputStream outputStream,
                                 long dataOffset)
                          throws IOException
Throws:
IOException