Mercurial > hg > graal-jvmci-8
annotate graal/com.oracle.truffle.api.object/src/com/oracle/truffle/api/object/Property.java @ 21052:de8880bbf2e1
Truffle: simplify getProperty; minor cleanup
author | Andreas Woess <andreas.woess@oracle.com> |
---|---|
date | Mon, 20 Apr 2015 14:22:01 +0200 |
parents | f439fdb137a3 |
children |
rev | line source |
---|---|
18407
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
1 /* |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
2 * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved. |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
4 * |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
5 * This code is free software; you can redistribute it and/or modify it |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
6 * under the terms of the GNU General Public License version 2 only, as |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
7 * published by the Free Software Foundation. Oracle designates this |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
8 * particular file as subject to the "Classpath" exception as provided |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
9 * by Oracle in the LICENSE file that accompanied this code. |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
10 * |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
11 * This code is distributed in the hope that it will be useful, but WITHOUT |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
14 * version 2 for more details (a copy is included in the LICENSE file that |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
15 * accompanied this code). |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
16 * |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
17 * You should have received a copy of the GNU General Public License version |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
18 * 2 along with this work; if not, write to the Free Software Foundation, |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
20 * |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
22 * or visit www.oracle.com if you need additional information or have any |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
23 * questions. |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
24 */ |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
25 package com.oracle.truffle.api.object; |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
26 |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
27 /** |
21052
de8880bbf2e1
Truffle: simplify getProperty; minor cleanup
Andreas Woess <andreas.woess@oracle.com>
parents:
18407
diff
changeset
|
28 * Property objects represent the mapping between property identifiers (keys) and storage locations. |
de8880bbf2e1
Truffle: simplify getProperty; minor cleanup
Andreas Woess <andreas.woess@oracle.com>
parents:
18407
diff
changeset
|
29 * Optionally, properties may have metadata attached to them. |
18407
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
30 */ |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
31 public abstract class Property { |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
32 protected Property() { |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
33 } |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
34 |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
35 public static Property create(Object key, Location location, int flags) { |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
36 return Layout.getFactory().createProperty(key, location, flags); |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
37 } |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
38 |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
39 /** |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
40 * Get property identifier. |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
41 */ |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
42 public abstract Object getKey(); |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
43 |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
44 /** |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
45 * Get property flags. |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
46 */ |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
47 public abstract int getFlags(); |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
48 |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
49 /** |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
50 * Change the property's location. |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
51 * |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
52 * @return a Property with the new location (or {@code this} if the location is unchanged). |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
53 */ |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
54 public abstract Property relocate(Location newLocation); |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
55 |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
56 /** |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
57 * Gets the value of this property of the object. |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
58 * |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
59 * @param store the store that this property resides in |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
60 * @param shape the current shape of the object, which must contain this location |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
61 * @see DynamicObject#get(Object, Object) |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
62 */ |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
63 public abstract Object get(DynamicObject store, Shape shape); |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
64 |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
65 /** |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
66 * Gets the value of this property of the object. |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
67 * |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
68 * @param store the store that this property resides in |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
69 * @param condition the result of a shape check or {@code false} |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
70 * @see DynamicObject#get(Object, Object) |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
71 * @see #get(DynamicObject, Shape) |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
72 */ |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
73 public abstract Object get(DynamicObject store, boolean condition); |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
74 |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
75 /** |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
76 * Assigns value to this property of the object. |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
77 * |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
78 * Throws an exception if the value cannot be assigned to the property's current location. |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
79 * |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
80 * @param store the store that this property resides in |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
81 * @param value the value to assign |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
82 * @param shape the current shape of the object or {@code null} |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
83 * @throws IncompatibleLocationException if the value is incompatible with the property location |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
84 * @throws FinalLocationException if the location is final and values differ |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
85 * @see DynamicObject#set(Object, Object) |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
86 */ |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
87 public abstract void set(DynamicObject store, Object value, Shape shape) throws IncompatibleLocationException, FinalLocationException; |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
88 |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
89 /** |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
90 * Assigns value to this property of the object. |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
91 * |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
92 * Automatically relocates the property if the value cannot be assigned to its current location. |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
93 * |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
94 * @param shape the current shape of the object or {@code null} |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
95 */ |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
96 public abstract void setGeneric(DynamicObject store, Object value, Shape shape); |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
97 |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
98 /** |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
99 * Like {@link #set(DynamicObject, Object, Shape)}, but throws an {@link IllegalStateException} |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
100 * instead. |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
101 */ |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
102 public abstract void setSafe(DynamicObject store, Object value, Shape shape); |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
103 |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
104 /** |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
105 * Like {@link #setSafe}, but ignores the finalness of the property. For internal use only. |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
106 * |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
107 * @param store the store that this property resides in |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
108 * @param value the value to assign |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
109 */ |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
110 public abstract void setInternal(DynamicObject store, Object value); |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
111 |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
112 /** |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
113 * Assigns value to this property of the object, changing the object's shape. |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
114 * |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
115 * Combines {@link DynamicObject#setShapeAndGrow(Shape, Shape)} and |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
116 * {@link #set(DynamicObject, Object, Shape)} to an atomic operation. |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
117 * |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
118 * @param store the store that this property resides in |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
119 * @param value the value to assign |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
120 * @param oldShape the shape before the transition |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
121 * @param newShape the shape after the transition |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
122 * @throws IncompatibleLocationException if the value is incompatible with the property location |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
123 */ |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
124 public abstract void set(DynamicObject store, Object value, Shape oldShape, Shape newShape) throws IncompatibleLocationException; |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
125 |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
126 /** |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
127 * Assigns value to this property of the object, changing the object's shape. |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
128 * |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
129 * Combines {@link DynamicObject#setShapeAndGrow(Shape, Shape)} and |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
130 * {@link #setGeneric(DynamicObject, Object, Shape)} to an atomic operation. |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
131 * |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
132 * @param store the store that this property resides in |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
133 * @param value the value to assign |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
134 * @param oldShape the shape before the transition |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
135 * @param newShape the shape after the transition |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
136 */ |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
137 public abstract void setGeneric(DynamicObject store, Object value, Shape oldShape, Shape newShape); |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
138 |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
139 /** |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
140 * Assigns value to this property of the object, changing the object's shape. |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
141 * |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
142 * Combines {@link DynamicObject#setShapeAndGrow(Shape, Shape)} and |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
143 * {@link #setSafe(DynamicObject, Object, Shape)} to an atomic operation. |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
144 * |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
145 * @param store the store that this property resides in |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
146 * @param value the value to assign |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
147 * @param oldShape the shape before the transition |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
148 * @param newShape the shape after the transition |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
149 */ |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
150 public abstract void setSafe(DynamicObject store, Object value, Shape oldShape, Shape newShape); |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
151 |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
152 /** |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
153 * Returns {@code true} if this property and some other property have the same key and flags. |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
154 */ |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
155 public abstract boolean isSame(Property other); |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
156 |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
157 /** |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
158 * Get the property location. |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
159 */ |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
160 public abstract Location getLocation(); |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
161 |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
162 /** |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
163 * Is this property hidden from iteration. |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
164 * |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
165 * @see HiddenKey |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
166 */ |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
167 public abstract boolean isHidden(); |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
168 |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
169 public abstract boolean isShadow(); |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
170 |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
171 /** |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
172 * Create a copy of the property with the given flags. |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
173 */ |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
174 public abstract Property copyWithFlags(int newFlags); |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
175 |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
176 public abstract Property copyWithRelocatable(boolean newRelocatable); |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
177 } |