org.zmpp.iff
Class DefaultChunk

java.lang.Object
  extended by org.zmpp.iff.DefaultChunk
All Implemented Interfaces:
Chunk
Direct Known Subclasses:
DefaultFormChunk

public class DefaultChunk
extends Object
implements Chunk

This is the default implementation of the Chunk interface.

Version:
1.0
Author:
Wei-ju Wu

Field Summary
protected  MemoryAccess memaccess
          The memory access object.
 
Fields inherited from interface org.zmpp.iff.Chunk
CHUNK_HEADER_LENGTH, CHUNK_ID_LENGTH, CHUNK_SIZEWORD_LENGTH
 
Constructor Summary
DefaultChunk(MemoryAccess memaccess)
          Constructor.
 
Method Summary
 byte[] getId()
          Returns this IFF chunk's id.
 MemoryAccess getMemoryAccess()
          Returns a memory access object to the chunk.
 int getSize()
          The chunk data size, excluding id and size word.
 boolean isValid()
          Returns true if this is a valid chunk.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

memaccess

protected MemoryAccess memaccess
The memory access object.

Constructor Detail

DefaultChunk

public DefaultChunk(MemoryAccess memaccess)
Constructor.

Parameters:
memaccess - a memory access object to the chunk data
Method Detail

isValid

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

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

getId

public byte[] getId()
Returns this IFF chunk's id. An id is a 4 byte array.

Specified by:
getId in interface Chunk
Returns:
the id

getSize

public int getSize()
The chunk data size, excluding id and size word.

Specified by:
getSize in interface Chunk
Returns:
the size

getMemoryAccess

public MemoryAccess getMemoryAccess()
Returns a memory access object to the chunk.

Specified by:
getMemoryAccess in interface Chunk
Returns:
the MemoryAccess object


Copyright © 2005 . All Rights Reserved.