Mercurial > hg > graal-compiler
annotate graal/com.oracle.truffle.api.object/src/com/oracle/truffle/api/object/Shape.java @ 20097:e8e55ebcf069
Truffle: implement language agnostic OSR support.
author | Christian Humer <christian.humer@gmail.com> |
---|---|
date | Tue, 31 Mar 2015 02:16:33 +0200 |
parents | f439fdb137a3 |
children | f929f601bdca |
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 import java.util.*; |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
28 |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
29 import com.oracle.truffle.api.*; |
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 /** |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
32 * Shape objects create a mapping of Property objects to Locations. Shapes are immutable; adding or |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
33 * deleting a property yields a new Shape which links to the old one. This allows inline caching to |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
34 * simply check the identity of an object's Shape to determine if the cache is valid. There is one |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
35 * exception to this immutability, the transition map, but that is used simply to assure that an |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
36 * identical series of property additions and deletions will yield the same Shape object. |
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 * @see DynamicObject |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
39 * @see Property |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
40 * @see Location |
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 class Shape { |
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 * Get a property entry by key. |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
45 * |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
46 * @param key the identifier to look up |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
47 * @return a Property object, or null if not found |
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 public abstract Property getProperty(Object key); |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
50 |
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 * Add a new property in the map, yielding a new or cached Shape object. |
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 * @param property the property to add |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
55 * @return the new Shape |
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 public abstract Shape addProperty(Property property); |
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 /** |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
60 * An {@link Iterable} over the shape's properties in insertion order. |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
61 */ |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
62 public abstract Iterable<Property> getProperties(); |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
63 |
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 * Get a list of properties that this Shape stores. |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
66 * |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
67 * @return list of properties |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
68 */ |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
69 public abstract List<Property> getPropertyList(Pred<Property> filter); |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
70 |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
71 /** |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
72 * Get a list of all properties that this Shape stores. |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
73 * |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
74 * @return list of properties |
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 public abstract List<Property> getPropertyList(); |
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 /** |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
79 * Returns all (also hidden) property objects in this shape. |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
80 * |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
81 * @param ascending desired order ({@code true} for insertion order, {@code false} for reverse |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
82 * insertion order) |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
83 */ |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
84 public abstract List<Property> getPropertyListInternal(boolean ascending); |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
85 |
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 * Get a filtered list of property keys in insertion order. |
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 public abstract List<Object> getKeyList(Pred<Property> filter); |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
90 |
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 * Get a list of all property keys in insertion order. |
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 public abstract List<Object> getKeyList(); |
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 /** |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
97 * Get all property keys in insertion order. |
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 public abstract Iterable<Object> getKeys(); |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
100 |
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 * Get an assumption that the shape is valid. |
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 public abstract Assumption getValidAssumption(); |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
105 |
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 * Check whether this shape is valid. |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
108 */ |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
109 public abstract boolean isValid(); |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
110 |
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 * Get an assumption that the shape is a leaf. |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
113 */ |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
114 public abstract Assumption getLeafAssumption(); |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
115 |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
116 /** |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
117 * Check whether this shape is a leaf in the transition graph, i.e. transitionless. |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
118 */ |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
119 public abstract boolean isLeaf(); |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
120 |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
121 /** |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
122 * @return the parent shape or {@code null} if none. |
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 Shape getParent(); |
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 * Check whether the shape has a property with the given key. |
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 public abstract boolean hasProperty(Object key); |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
130 |
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 * Remove the given property from the shape. |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
133 */ |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
134 public abstract Shape removeProperty(Property property); |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
135 |
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 * Replace a property in the shape. |
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 public abstract Shape replaceProperty(Property oldProperty, Property newProperty); |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
140 |
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 * Get the last added property. |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
143 */ |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
144 public abstract Property getLastProperty(); |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
145 |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
146 public abstract int getId(); |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
147 |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
148 /** |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
149 * Append the property, relocating it to the next allocated location. |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
150 */ |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
151 public abstract Shape append(Property oldProperty); |
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 /** |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
154 * Obtain an {@link Allocator} instance for the purpose of allocating locations. |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
155 */ |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
156 public abstract Allocator allocator(); |
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 /** |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
159 * For copying over properties after exchanging the prototype of an object. |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
160 */ |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
161 public abstract Shape copyOverPropertiesInternal(Shape destination); |
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 /** |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
164 * Get number of properties in this shape. |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
165 */ |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
166 public abstract int getPropertyCount(); |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
167 |
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 * Get the shape's operations. |
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 public abstract ObjectType getObjectType(); |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
172 |
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 * Get the root shape. |
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 Shape getRoot(); |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
177 |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
178 /** |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
179 * Check whether this shape is identical to the given shape. |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
180 */ |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
181 public abstract boolean check(DynamicObject subject); |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
182 |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
183 /** |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
184 * Get the shape's layout. |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
185 */ |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
186 public abstract Layout getLayout(); |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
187 |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
188 /** |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
189 * Get the shape's custom data. |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
190 */ |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
191 public abstract Object getData(); |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
192 |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
193 /** |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
194 * Get the shape's shared data. |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
195 */ |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
196 public abstract Object getSharedData(); |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
197 |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
198 /** |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
199 * Query whether the shape has a transition with the given key. |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
200 */ |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
201 public abstract boolean hasTransitionWithKey(Object key); |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
202 |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
203 /** |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
204 * Clone off a separate shape with new shared data. |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
205 */ |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
206 public abstract Shape createSeparateShape(Object sharedData); |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
207 |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
208 /** |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
209 * Change the shape's type, yielding a new shape. |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
210 */ |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
211 public abstract Shape changeType(ObjectType newOps); |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
212 |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
213 /** |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
214 * Reserve the primitive extension array field. |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
215 */ |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
216 public abstract Shape reservePrimitiveExtensionArray(); |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
217 |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
218 /** |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
219 * Create a new {@link DynamicObject} instance with this shape. |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
220 */ |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
221 public abstract DynamicObject newInstance(); |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
222 |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
223 /** |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
224 * Create a {@link DynamicObjectFactory} for creating instances of this shape. |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
225 */ |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
226 public abstract DynamicObjectFactory createFactory(); |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
227 |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
228 /** |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
229 * Get mutex object shared by related shapes, i.e. shapes with a common root. |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
230 */ |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
231 public abstract Object getMutex(); |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
232 |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
233 public abstract int getObjectArraySize(); |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
234 |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
235 public abstract int getObjectFieldSize(); |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
236 |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
237 public abstract int getPrimitiveArraySize(); |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
238 |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
239 public abstract int getPrimitiveFieldSize(); |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
240 |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
241 public abstract int getObjectArrayCapacity(); |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
242 |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
243 public abstract int getPrimitiveArrayCapacity(); |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
244 |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
245 public abstract boolean hasPrimitiveArray(); |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
246 |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
247 /** |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
248 * Are these two shapes related, i.e. do they have the same root? |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
249 * |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
250 * @param other Shape to compare to |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
251 * @return true if one shape is an upcast of the other, or the Shapes are equal |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
252 */ |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
253 public abstract boolean isRelated(Shape other); |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
254 |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
255 public abstract Shape tryMerge(Shape other); |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
256 |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
257 public <R> R accept(ShapeVisitor<R> visitor) { |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
258 return visitor.visitShape(this); |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
259 } |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
260 |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
261 public abstract static class Allocator { |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
262 protected abstract Location locationForValue(Object value, boolean useFinal, boolean nonNull); |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
263 |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
264 public final Location locationForValue(Object value) { |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
265 return locationForValue(value, false, value != null); |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
266 } |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
267 |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
268 public final Location locationForValue(Object value, EnumSet<LocationModifier> modifiers) { |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
269 assert value != null || !modifiers.contains(LocationModifier.NonNull); |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
270 return locationForValue(value, modifiers.contains(LocationModifier.Final), modifiers.contains(LocationModifier.NonNull)); |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
271 } |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
272 |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
273 protected abstract Location locationForType(Class<?> type, boolean useFinal, boolean nonNull); |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
274 |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
275 public final Location locationForType(Class<?> type) { |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
276 return locationForType(type, false, false); |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
277 } |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
278 |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
279 public final Location locationForType(Class<?> type, EnumSet<LocationModifier> modifiers) { |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
280 return locationForType(type, modifiers.contains(LocationModifier.Final), modifiers.contains(LocationModifier.NonNull)); |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
281 } |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
282 |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
283 public abstract Location constantLocation(Object value); |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
284 |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
285 public abstract Location declaredLocation(Object value); |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
286 |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
287 public abstract Allocator addLocation(Location location); |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
288 } |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
289 |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
290 /** |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
291 * Represents a predicate (boolean-valued function) of one argument. For Java 7 compatibility. |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
292 * |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
293 * @param <T> the type of the input to the predicate |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
294 */ |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
295 public interface Pred<T> { |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
296 /** |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
297 * Evaluates this predicate on the given argument. |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
298 * |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
299 * @param t the input argument |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
300 * @return {@code true} if the input argument matches the predicate, otherwise {@code false} |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
301 */ |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
302 boolean test(T t); |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
303 } |
f439fdb137a3
Truffle: initial commit of object API
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
304 } |