uk.me.parabola.imgfmt.app
Class Section

java.lang.Object
  extended by uk.me.parabola.imgfmt.app.Section

public class Section
extends java.lang.Object

Represents an item size the position where those items start and the total size of the section.


Constructor Summary
Section()
           
Section(char itemSize)
           
Section(Section link)
           
Section(Section link, char itemSize)
           
 
Method Summary
static void close(ImgFileWriter writer)
           
 int getEndPos()
          Get the position of the end of the section.
protected  int getExtraValue()
           
 char getItemSize()
           
 int getNumItems()
          Get the number of items in the section.
 int getPosition()
          Get the start position of this section.
 int getSize()
           
 void inc()
           
 void readSectionInfo(ImgFileReader reader, boolean withItemSize)
           
 void setExtraValue(int extraValue)
           
 void setItemSize(char itemSize)
           
 void setPosition(int position)
           
 void setSize(int size)
           
 java.lang.String toString()
           
 void writeSectionInfo(ImgFileWriter writer)
           
 void writeSectionInfo(ImgFileWriter writer, boolean withItemSize)
           
 void writeSectionInfo(ImgFileWriter writer, boolean withItemSize, boolean withExtraValue)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Section

public Section()

Section

public Section(char itemSize)

Section

public Section(Section link,
               char itemSize)

Section

public Section(Section link)
Method Detail

inc

public void inc()

getItemSize

public char getItemSize()

setItemSize

public void setItemSize(char itemSize)

getSize

public int getSize()

setSize

public void setSize(int size)

getPosition

public int getPosition()
Get the start position of this section. If this is linked to another section, then we return the end address of that section.

Returns:
The first offset for this section.

setPosition

public void setPosition(int position)

getEndPos

public int getEndPos()
Get the position of the end of the section.

Returns:
The offset of the end of the section relative to the beginning of the application file.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getNumItems

public int getNumItems()
Get the number of items in the section. This should only be called if the itemSize is set.

Returns:
The number of items in the section, or zero if this is not a fixed size item kind of section.

getExtraValue

protected int getExtraValue()

setExtraValue

public void setExtraValue(int extraValue)

readSectionInfo

public void readSectionInfo(ImgFileReader reader,
                            boolean withItemSize)

writeSectionInfo

public void writeSectionInfo(ImgFileWriter writer)

writeSectionInfo

public void writeSectionInfo(ImgFileWriter writer,
                             boolean withItemSize)

writeSectionInfo

public void writeSectionInfo(ImgFileWriter writer,
                             boolean withItemSize,
                             boolean withExtraValue)

close

public static void close(ImgFileWriter writer)