nwnintf.format.itp
Class ItpFile

java.lang.Object
  |
  +--nwnintf.format.itp.ItpFile

public class ItpFile
extends java.lang.Object

Represent an "itp" file. Also called "GFF". The current implementation is according to Torlack's document: http://www.torlack.com/index.html?topics=nwndata_itp which was superceded by: http://nwn.bioware.com/developers/erf.html So there may be errors and omissions in this code.


Field Summary
static int ELEMENTOFFSET
           
static int ENTRYOFFSET
           
static int LISTBYTES
           
static int LISTOFFSET
           
static int MULTIMAPOFFSET
           
static int NELEMENTS
           
static int NENTRIES
           
static int NMULTIMAPBYTES
           
static int NVARDATABYTES
           
static int NVARNAMES
           
static int SIZE
           
static int TYPE
           
static int VARDATAOFFSET
           
static int VARNAMEOFFSET
           
static int VERSION
           
 
Constructor Summary
ItpFile(byte[] bytes)
          Interpret a sequence of bytes representing a GFF file.
ItpFile(byte[] bytes, int offset)
          Interpret a sequence of bytes starting at a particular offset as a GFF File.
ItpFile(java.lang.String type, java.lang.String version)
          Create a new ItpFile from scratch.
 
Method Summary
 void addElement(ItpElement element)
           
 void addEntry(ItpEntry entry)
           
 ItpElement element(int idx)
           
 ItpEntry entry(int idx)
          Return the
 int indexOfElement(ItpElement elt)
           
 int indexOfEntry(ItpEntry ent)
           
static void main(java.lang.String[] args)
          This test function may be out-of-date w.r.t. the API.
 int nelements()
           
 int nentries()
           
 void removeElement(ItpElement element)
          Recursively deletes contained elements and entries.
 void removeEntry(ItpEntry entry)
          Recursively deletes contained elements and entries.
 ItpEntry root()
           
 void setType(java.lang.String type)
           
 void setVersion(java.lang.String version)
           
 java.lang.String type()
           
 java.lang.String version()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SIZE

public static int SIZE

TYPE

public static int TYPE

VERSION

public static int VERSION

ENTRYOFFSET

public static int ENTRYOFFSET

NENTRIES

public static int NENTRIES

ELEMENTOFFSET

public static int ELEMENTOFFSET

NELEMENTS

public static int NELEMENTS

VARNAMEOFFSET

public static int VARNAMEOFFSET

NVARNAMES

public static int NVARNAMES

VARDATAOFFSET

public static int VARDATAOFFSET

NVARDATABYTES

public static int NVARDATABYTES

MULTIMAPOFFSET

public static int MULTIMAPOFFSET

NMULTIMAPBYTES

public static int NMULTIMAPBYTES

LISTOFFSET

public static int LISTOFFSET

LISTBYTES

public static int LISTBYTES
Constructor Detail

ItpFile

public ItpFile(java.lang.String type,
               java.lang.String version)
Create a new ItpFile from scratch.


ItpFile

public ItpFile(byte[] bytes)
        throws java.lang.Exception
Interpret a sequence of bytes representing a GFF file.


ItpFile

public ItpFile(byte[] bytes,
               int offset)
        throws java.lang.Exception
Interpret a sequence of bytes starting at a particular offset as a GFF File.

Method Detail

entry

public ItpEntry entry(int idx)
Return the


element

public ItpElement element(int idx)

root

public ItpEntry root()

indexOfEntry

public int indexOfEntry(ItpEntry ent)

indexOfElement

public int indexOfElement(ItpElement elt)

nentries

public int nentries()

nelements

public int nelements()

addEntry

public void addEntry(ItpEntry entry)

addElement

public void addElement(ItpElement element)

removeEntry

public void removeEntry(ItpEntry entry)
Recursively deletes contained elements and entries.


removeElement

public void removeElement(ItpElement element)
Recursively deletes contained elements and entries.


type

public java.lang.String type()

version

public java.lang.String version()

setType

public void setType(java.lang.String type)

setVersion

public void setVersion(java.lang.String version)

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
This test function may be out-of-date w.r.t. the API.

java.lang.Exception