equal
deleted
inserted
replaced
1 /* |
1 /* |
2 * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. Oracle designates this |
7 * published by the Free Software Foundation. Oracle designates this |
35 import javax.lang.model.type.*; |
35 import javax.lang.model.type.*; |
36 import javax.lang.model.util.*; |
36 import javax.lang.model.util.*; |
37 |
37 |
38 |
38 |
39 /** |
39 /** |
40 * Represents a program element such as a package, class, or method. |
40 * Represents a program element such as a module, package, class, or method. |
41 * Each element represents a static, language-level construct |
41 * Each element represents a static, language-level construct |
42 * (and not, for example, a runtime construct of the virtual machine). |
42 * (and not, for example, a runtime construct of the virtual machine). |
43 * |
43 * |
44 * <p> Elements should be compared using the {@link #equals(Object)} |
44 * <p> Elements should be compared using the {@link #equals(Object)} |
45 * method. There is no guarantee that any particular element will |
45 * method. There is no guarantee that any particular element will |
178 * |
178 * |
179 * Other kinds of elements are not currently considered to enclose |
179 * Other kinds of elements are not currently considered to enclose |
180 * any elements; however, that may change as this API or the |
180 * any elements; however, that may change as this API or the |
181 * programming language evolves. |
181 * programming language evolves. |
182 * |
182 * |
183 * <p>Note that elements of certain kinds can be isolated using |
183 * @apiNote Elements of certain kinds can be isolated using |
184 * methods in {@link ElementFilter}. |
184 * methods in {@link ElementFilter}. |
185 * |
185 * |
186 * @return the enclosed elements, or an empty list if none |
186 * @return the enclosed elements, or an empty list if none |
187 * @see TypeElement#getEnclosedElements |
187 * @see TypeElement#getEnclosedElements |
188 * @see PackageElement#getEnclosedElements |
188 * @see PackageElement#getEnclosedElements |
195 |
195 |
196 /** |
196 /** |
197 * Returns {@code true} if the argument represents the same |
197 * Returns {@code true} if the argument represents the same |
198 * element as {@code this}, or {@code false} otherwise. |
198 * element as {@code this}, or {@code false} otherwise. |
199 * |
199 * |
200 * <p>Note that the identity of an element involves implicit state |
200 * @apiNote The identity of an element involves implicit state |
201 * not directly accessible from the element's methods, including |
201 * not directly accessible from the element's methods, including |
202 * state about the presence of unrelated types. Element objects |
202 * state about the presence of unrelated types. Element objects |
203 * created by different implementations of these interfaces should |
203 * created by different implementations of these interfaces should |
204 * <i>not</i> be expected to be equal even if "the same" |
204 * <i>not</i> be expected to be equal even if "the same" |
205 * element is being modeled; this is analogous to the inequality |
205 * element is being modeled; this is analogous to the inequality |