org.zmpp.vm
Class Objects

java.lang.Object
  extended by org.zmpp.vm.Objects
All Implemented Interfaces:
ObjectTree

public class Objects
extends Object
implements ObjectTree

This class represents the object table.

Version:
1.0
Author:
Wei-ju Wu

Constructor Summary
Objects(MemoryAccess memaccess, int address)
          Constructor.
 
Method Summary
 int getNumObjects()
          Returns the total number of objects.
 ZObject getObject(int objectNum)
          Returns the Z-object with the specified object number.
 short getPropertyDefault(int propertyNum)
          Returns the property default value at the specified position in the property defaults table.
 int getPropertyLength(int propertyAddress)
          Determines the length of the property at the specified address.
 void insertObject(int parentNum, int objectNum)
          Inserts an object to a new parent.
 void removeObject(int objectNum)
          Removes an object from its parent.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Objects

public Objects(MemoryAccess memaccess,
               int address)
Constructor.

Parameters:
memaccess - the memory access object
address - the object table's start address
Method Detail

getPropertyDefault

public short getPropertyDefault(int propertyNum)
Returns the property default value at the specified position in the property defaults table.

Specified by:
getPropertyDefault in interface ObjectTree
Parameters:
propertyNum - the default entry's propery number
Returns:
the property default value

getNumObjects

public int getNumObjects()
Returns the total number of objects.

Specified by:
getNumObjects in interface ObjectTree
Returns:
the number of objects

getObject

public ZObject getObject(int objectNum)
Returns the Z-object with the specified object number. The index is 1 based

Specified by:
getObject in interface ObjectTree
Parameters:
objectNum - object number
Returns:
the z object with the specified number

removeObject

public void removeObject(int objectNum)
Removes an object from its parent.

Specified by:
removeObject in interface ObjectTree
Parameters:
objectNum - the object number

insertObject

public void insertObject(int parentNum,
                         int objectNum)
Inserts an object to a new parent.

Specified by:
insertObject in interface ObjectTree
Parameters:
parentNum - the parent number
objectNum - the object number

getPropertyLength

public int getPropertyLength(int propertyAddress)
Determines the length of the property at the specified address. The address is an address returned by ZObject.getPropertyAddress, i.e. it is starting after the length byte.

Specified by:
getPropertyLength in interface ObjectTree
Parameters:
propertyAddress - the property address
Returns:
the length


Copyright © 2005 . All Rights Reserved.