1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23 package org.zmpp.vm;
24
25 /***
26 * This is the interface definition for an object in the object tree.
27 *
28 * @author Wei-ju Wu
29 * @version 1.0
30 */
31 public interface ZObject {
32
33 /***
34 * Tests if the specified attribute is set.
35 *
36 * @param attributeNum the attribute number, starting with 0
37 * @return true if the attribute is set
38 */
39 boolean isAttributeSet(int attributeNum);
40
41 /***
42 * Sets the specified attribute.
43 *
44 * @param attributeNum the attribute number, starting with 0
45 */
46 void setAttribute(int attributeNum);
47
48
49 /***
50 * Clears the specified attribute.
51 *
52 * @param attributeNum the attribute number, starting with 0
53 */
54 void clearAttribute(int attributeNum);
55
56 /***
57 * Returns the number of this object's parent object.
58 *
59 * @return the parent object's number
60 */
61 int getParent();
62
63 /***
64 * Assigns a new parent object.
65 *
66 * @param parent the new parent object
67 */
68 void setParent(int parent);
69
70 /***
71 * Returns the object number of this object's sibling object.
72 *
73 * @return the sibling object's object number
74 */
75 int getSibling();
76
77 /***
78 * Assigns a new sibling to this object.
79 *
80 * @param sibling the new sibling's object number
81 */
82 void setSibling(int sibling);
83
84 /***
85 * Returns the object number of this object's child object.
86 *
87 * @return the child object's object number
88 */
89 int getChild();
90
91 /***
92 * Assigns a new child to this object.
93 *
94 * @param child the new child
95 */
96 void setChild(int child);
97
98 /***
99 * Returns this object's property table address. Might be made private
100 * in the future.
101 *
102 * @return the address of this object's property table
103 */
104 int getPropertyTableAddress();
105
106 /***
107 * Returns the properties description address.
108 *
109 * @return the description address
110 */
111 int getPropertiesDescriptionAddress();
112
113 /***
114 * Returns the number of properties.
115 *
116 * @return the number of properties
117 */
118 int getNumProperties();
119
120 /***
121 * The number of bytes in the specified property.
122 *
123 * @param property the property number
124 * @return the specified property's number of bytes
125 */
126 int getPropertySize(int property);
127
128 /***
129 * Returns the the specified property byte.
130 *
131 * @param property the property number
132 * @param bytenum the byte number
133 * @return the value of the specified property byte
134 */
135 byte getPropertyByte(int property, int bytenum);
136
137 /***
138 * Returns the address of the specified property. Note that this will not
139 * include the length byte.
140 *
141 * @param property the property
142 * @return the specified property's address
143 */
144 int getPropertyAddress(int property);
145
146 /***
147 * Returns true if the specified property is available.
148 *
149 * @param property the property number
150 * @return true if the property is available, false otherwise
151 */
152 boolean isPropertyAvailable(int property);
153
154 /***
155 * Returns the next property in the list. If property is 0, this
156 * will return the first propery number, if propery is the last
157 * element in the list, it will return 0.
158 *
159 * @param property the property number
160 * @return the next property in the list or 0
161 */
162 int getNextProperty(int property);
163
164 /***
165 * Sets the specified property byte to the given value.
166 *
167 * @param property the property
168 * @param bytenum the byte number
169 * @param value the value
170 */
171 void setPropertyByte(int property, int bytenum, byte value);
172 }