Mercurial > hg > truffle
comparison truffle/com.oracle.truffle.api.object/src/com/oracle/truffle/api/object/Layout.java @ 22325:414e82b9fc35
Release 0.9 is out, let's remove deprecated elements from the API
author | Jaroslav Tulach <jaroslav.tulach@oracle.com> |
---|---|
date | Fri, 23 Oct 2015 20:23:00 +0200 |
parents | 8bc57c7bbf88 |
children | bb3c03f2442d |
comparison
equal
deleted
inserted
replaced
22324:ad67d348e361 | 22325:414e82b9fc35 |
---|---|
33 * Describes layout and behavior of a {@link DynamicObject} subclass and is used to create shapes. | 33 * Describes layout and behavior of a {@link DynamicObject} subclass and is used to create shapes. |
34 * | 34 * |
35 * An object may change its shape but only to shapes of the same layout. | 35 * An object may change its shape but only to shapes of the same layout. |
36 */ | 36 */ |
37 public abstract class Layout { | 37 public abstract class Layout { |
38 @Deprecated public static final EnumSet<ImplicitCast> NONE = EnumSet.noneOf(ImplicitCast.class); | |
39 @Deprecated public static final EnumSet<ImplicitCast> INT_TO_DOUBLE = EnumSet.of(ImplicitCast.IntToDouble); | |
40 @Deprecated public static final EnumSet<ImplicitCast> INT_TO_LONG = EnumSet.of(ImplicitCast.IntToLong); | |
41 | |
42 public static final String OPTION_PREFIX = "truffle.object."; | 38 public static final String OPTION_PREFIX = "truffle.object."; |
43 | 39 |
44 private static final LayoutFactory LAYOUT_FACTORY = loadLayoutFactory(); | 40 private static final LayoutFactory LAYOUT_FACTORY = loadLayoutFactory(); |
45 | 41 |
46 /** | 42 /** |
61 /** | 57 /** |
62 * Equivalent to {@code Layout.newLayout().build()}. | 58 * Equivalent to {@code Layout.newLayout().build()}. |
63 */ | 59 */ |
64 public static Layout createLayout() { | 60 public static Layout createLayout() { |
65 return newLayout().build(); | 61 return newLayout().build(); |
66 } | |
67 | |
68 /** | |
69 * Equivalent to | |
70 * {@code Layout.newLayout().setAllowedImplicitCasts(allowedImplicitCasts).build()}. | |
71 */ | |
72 @Deprecated | |
73 public static Layout createLayout(EnumSet<ImplicitCast> allowedImplicitCasts) { | |
74 return newLayout().setAllowedImplicitCasts(allowedImplicitCasts).build(); | |
75 } | 62 } |
76 | 63 |
77 public abstract DynamicObject newInstance(Shape shape); | 64 public abstract DynamicObject newInstance(Shape shape); |
78 | 65 |
79 public abstract Class<? extends DynamicObject> getType(); | 66 public abstract Class<? extends DynamicObject> getType(); |
166 */ | 153 */ |
167 public Builder addAllowedImplicitCast(ImplicitCast allowedImplicitCast) { | 154 public Builder addAllowedImplicitCast(ImplicitCast allowedImplicitCast) { |
168 this.allowedImplicitCasts.add(allowedImplicitCast); | 155 this.allowedImplicitCasts.add(allowedImplicitCast); |
169 return this; | 156 return this; |
170 } | 157 } |
171 | |
172 @Deprecated | |
173 public EnumSet<ImplicitCast> getAllowedImplicitCasts() { | |
174 return allowedImplicitCasts; | |
175 } | |
176 } | 158 } |
177 | 159 |
178 protected static EnumSet<ImplicitCast> getAllowedImplicitCasts(Builder builder) { | 160 protected static EnumSet<ImplicitCast> getAllowedImplicitCasts(Builder builder) { |
179 return builder.allowedImplicitCasts; | 161 return builder.allowedImplicitCasts; |
180 } | 162 } |