comparison truffle/com.oracle.truffle.api.object/src/com/oracle/truffle/api/object/Shape.java @ 22288:47172a9b40ac

Object model refactoring, add Shape#defineProperty
author Andreas Woess <andreas.woess@oracle.com>
date Wed, 07 Oct 2015 19:15:14 +0200
parents dc83cc1f94f2
children
comparison
equal deleted inserted replaced
22287:479028cce974 22288:47172a9b40ac
23 * questions. 23 * questions.
24 */ 24 */
25 package com.oracle.truffle.api.object; 25 package com.oracle.truffle.api.object;
26 26
27 import com.oracle.truffle.api.Assumption; 27 import com.oracle.truffle.api.Assumption;
28
28 import java.util.EnumSet; 29 import java.util.EnumSet;
29 import java.util.List; 30 import java.util.List;
30 31
31 /** 32 /**
32 * Shape objects create a mapping of Property objects to Locations. Shapes are immutable; adding or 33 * Shape objects create a mapping of Property objects to Locations. Shapes are immutable; adding or
55 * @return the new Shape 56 * @return the new Shape
56 */ 57 */
57 public abstract Shape addProperty(Property property); 58 public abstract Shape addProperty(Property property);
58 59
59 /** 60 /**
61 * Add or change property in the map, yielding a new or cached Shape object.
62 *
63 * @return the shape after defining the property
64 */
65 public abstract Shape defineProperty(Object key, Object value, int flags);
66
67 /**
68 * Add or change property in the map, yielding a new or cached Shape object.
69 *
70 * @return the shape after defining the property
71 */
72 public abstract Shape defineProperty(Object key, Object value, int flags, LocationFactory locationFactory);
73
74 /**
60 * An {@link Iterable} over the shape's properties in insertion order. 75 * An {@link Iterable} over the shape's properties in insertion order.
61 */ 76 */
62 public abstract Iterable<Property> getProperties(); 77 public abstract Iterable<Property> getProperties();
63 78
64 /** 79 /**