org.zmpp.vm
Interface ZObject

All Known Implementing Classes:
DefaultZObject

public interface ZObject

This is the interface definition for an object in the object tree.

Version:
1.0
Author:
Wei-ju Wu

Method Summary
 void clearAttribute(int attributeNum)
          Clears the specified attribute.
 int getChild()
          Returns the object number of this object's child object.
 int getNextProperty(int property)
          Returns the next property in the list.
 int getNumProperties()
          Returns the number of properties.
 int getParent()
          Returns the number of this object's parent object.
 int getPropertiesDescriptionAddress()
          Returns the properties description address.
 int getPropertyAddress(int property)
          Returns the address of the specified property.
 byte getPropertyByte(int property, int bytenum)
          Returns the the specified property byte.
 int getPropertySize(int property)
          The number of bytes in the specified property.
 int getPropertyTableAddress()
          Returns this object's property table address.
 int getSibling()
          Returns the object number of this object's sibling object.
 boolean isAttributeSet(int attributeNum)
          Tests if the specified attribute is set.
 boolean isPropertyAvailable(int property)
          Returns true if the specified property is available.
 void setAttribute(int attributeNum)
          Sets the specified attribute.
 void setChild(int child)
          Assigns a new child to this object.
 void setParent(int parent)
          Assigns a new parent object.
 void setPropertyByte(int property, int bytenum, byte value)
          Sets the specified property byte to the given value.
 void setSibling(int sibling)
          Assigns a new sibling to this object.
 

Method Detail

isAttributeSet

boolean isAttributeSet(int attributeNum)
Tests if the specified attribute is set.

Parameters:
attributeNum - the attribute number, starting with 0
Returns:
true if the attribute is set

setAttribute

void setAttribute(int attributeNum)
Sets the specified attribute.

Parameters:
attributeNum - the attribute number, starting with 0

clearAttribute

void clearAttribute(int attributeNum)
Clears the specified attribute.

Parameters:
attributeNum - the attribute number, starting with 0

getParent

int getParent()
Returns the number of this object's parent object.

Returns:
the parent object's number

setParent

void setParent(int parent)
Assigns a new parent object.

Parameters:
parent - the new parent object

getSibling

int getSibling()
Returns the object number of this object's sibling object.

Returns:
the sibling object's object number

setSibling

void setSibling(int sibling)
Assigns a new sibling to this object.

Parameters:
sibling - the new sibling's object number

getChild

int getChild()
Returns the object number of this object's child object.

Returns:
the child object's object number

setChild

void setChild(int child)
Assigns a new child to this object.

Parameters:
child - the new child

getPropertyTableAddress

int getPropertyTableAddress()
Returns this object's property table address. Might be made private in the future.

Returns:
the address of this object's property table

getPropertiesDescriptionAddress

int getPropertiesDescriptionAddress()
Returns the properties description address.

Returns:
the description address

getNumProperties

int getNumProperties()
Returns the number of properties.

Returns:
the number of properties

getPropertySize

int getPropertySize(int property)
The number of bytes in the specified property.

Parameters:
property - the property number
Returns:
the specified property's number of bytes

getPropertyByte

byte getPropertyByte(int property,
                     int bytenum)
Returns the the specified property byte.

Parameters:
property - the property number
bytenum - the byte number
Returns:
the value of the specified property byte

getPropertyAddress

int getPropertyAddress(int property)
Returns the address of the specified property. Note that this will not include the length byte.

Parameters:
property - the property
Returns:
the specified property's address

isPropertyAvailable

boolean isPropertyAvailable(int property)
Returns true if the specified property is available.

Parameters:
property - the property number
Returns:
true if the property is available, false otherwise

getNextProperty

int getNextProperty(int property)
Returns the next property in the list. If property is 0, this will return the first propery number, if propery is the last element in the list, it will return 0.

Parameters:
property - the property number
Returns:
the next property in the list or 0

setPropertyByte

void setPropertyByte(int property,
                     int bytenum,
                     byte value)
Sets the specified property byte to the given value.

Parameters:
property - the property
bytenum - the byte number
value - the value


Copyright © 2005 . All Rights Reserved.