org.zmpp.iff
Class DefaultFormChunk

java.lang.Object
  extended by org.zmpp.iff.DefaultChunk
      extended by org.zmpp.iff.DefaultFormChunk
All Implemented Interfaces:
Chunk, FormChunk

public class DefaultFormChunk
extends DefaultChunk
implements FormChunk

This class implements the FormChunk interface.

Version:
1.0
Author:
Wei-ju Wu

Field Summary
 
Fields inherited from class org.zmpp.iff.DefaultChunk
memaccess
 
Fields inherited from interface org.zmpp.iff.Chunk
CHUNK_HEADER_LENGTH, CHUNK_ID_LENGTH, CHUNK_SIZEWORD_LENGTH
 
Constructor Summary
DefaultFormChunk(MemoryAccess memaccess)
          Constructor.
 
Method Summary
 Chunk getSubChunk(byte[] id)
          Returns the chunk with the specified id.
 Iterator<Chunk> getSubChunks()
          Returns an iterator of chunks contained in this form chunk.
 byte[] getSubId()
          Returns the sub id.
 boolean isValid()
          Returns true if this is a valid chunk.
 
Methods inherited from class org.zmpp.iff.DefaultChunk
getId, getMemoryAccess, getSize
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.zmpp.iff.Chunk
getId, getMemoryAccess, getSize
 

Constructor Detail

DefaultFormChunk

public DefaultFormChunk(MemoryAccess memaccess)
Constructor.

Parameters:
memaccess - a MemoryAccess object
Method Detail

isValid

public boolean isValid()
Returns true if this is a valid chunk.

Specified by:
isValid in interface Chunk
Overrides:
isValid in class DefaultChunk
Returns:
true if valid, false otherwise

getSubId

public byte[] getSubId()
Returns the sub id.

Specified by:
getSubId in interface FormChunk
Returns:
the sub id

getSubChunks

public Iterator<Chunk> getSubChunks()
Returns an iterator of chunks contained in this form chunk.

Specified by:
getSubChunks in interface FormChunk
Returns:
the enumeration of sub chunks

getSubChunk

public Chunk getSubChunk(byte[] id)
Returns the chunk with the specified id.

Specified by:
getSubChunk in interface FormChunk
Parameters:
id - the id
Returns:
the chunk with the specified id or null if it does not exist


Copyright © 2005 . All Rights Reserved.