Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
org.dartlang.analysis.server.protocol.TypeHierarchyItem Class Reference

Public Member Functions

 TypeHierarchyItem (Element classElement, String displayName, Element memberElement, Integer superclass, int[] interfaces, int[] mixins, int[] subclasses)
 
boolean equals (Object obj)
 
String getBestName ()
 
Element getClassElement ()
 
String getDisplayName ()
 
int[] getInterfaces ()
 
Element getMemberElement ()
 
int[] getMixins ()
 
int[] getSubclasses ()
 
Integer getSuperclass ()
 
int hashCode ()
 
JsonObject toJson ()
 
String toString ()
 

Static Public Member Functions

static TypeHierarchyItem fromJson (JsonObject jsonObject)
 
static List< TypeHierarchyItemfromJsonArray (JsonArray jsonArray)
 

Static Public Attributes

static final TypeHierarchyItem[] EMPTY_ARRAY = new TypeHierarchyItem[0]
 
static final List< TypeHierarchyItemEMPTY_LIST = Lists.newArrayList()
 

Detailed Description

A representation of a class in a type hierarchy.

@coverage dart.server.generated.types

Definition at line 32 of file TypeHierarchyItem.java.

Constructor & Destructor Documentation

◆ TypeHierarchyItem()

org.dartlang.analysis.server.protocol.TypeHierarchyItem.TypeHierarchyItem ( Element  classElement,
String  displayName,
Element  memberElement,
Integer  superclass,
int[]  interfaces,
int[]  mixins,
int[]  subclasses 
)
inline

Constructor for TypeHierarchyItem.

Definition at line 84 of file TypeHierarchyItem.java.

84 {
85 this.classElement = classElement;
86 this.displayName = displayName;
87 this.memberElement = memberElement;
88 this.superclass = superclass;
89 this.interfaces = interfaces;
90 this.mixins = mixins;
91 this.subclasses = subclasses;
92 }

Member Function Documentation

◆ equals()

boolean org.dartlang.analysis.server.protocol.TypeHierarchyItem.equals ( Object  obj)
inline

Definition at line 95 of file TypeHierarchyItem.java.

95 {
96 if (obj instanceof TypeHierarchyItem) {
97 TypeHierarchyItem other = (TypeHierarchyItem) obj;
98 return
99 ObjectUtilities.equals(other.classElement, classElement) &&
100 ObjectUtilities.equals(other.displayName, displayName) &&
101 ObjectUtilities.equals(other.memberElement, memberElement) &&
102 ObjectUtilities.equals(other.superclass, superclass) &&
103 Arrays.equals(other.interfaces, interfaces) &&
104 Arrays.equals(other.mixins, mixins) &&
105 Arrays.equals(other.subclasses, subclasses);
106 }
107 return false;
108 }

◆ fromJson()

static TypeHierarchyItem org.dartlang.analysis.server.protocol.TypeHierarchyItem.fromJson ( JsonObject  jsonObject)
inlinestatic

Definition at line 110 of file TypeHierarchyItem.java.

110 {
111 Element classElement = Element.fromJson(jsonObject.get("classElement").getAsJsonObject());
112 String displayName = jsonObject.get("displayName") == null ? null : jsonObject.get("displayName").getAsString();
113 Element memberElement = jsonObject.get("memberElement") == null ? null : Element.fromJson(jsonObject.get("memberElement").getAsJsonObject());
114 Integer superclass = jsonObject.get("superclass") == null ? null : jsonObject.get("superclass").getAsInt();
115 int[] interfaces = JsonUtilities.decodeIntArray(jsonObject.get("interfaces").getAsJsonArray());
116 int[] mixins = JsonUtilities.decodeIntArray(jsonObject.get("mixins").getAsJsonArray());
117 int[] subclasses = JsonUtilities.decodeIntArray(jsonObject.get("subclasses").getAsJsonArray());
118 return new TypeHierarchyItem(classElement, displayName, memberElement, superclass, interfaces, mixins, subclasses);
119 }
TypeHierarchyItem(Element classElement, String displayName, Element memberElement, Integer superclass, int[] interfaces, int[] mixins, int[] subclasses)

◆ fromJsonArray()

static List< TypeHierarchyItem > org.dartlang.analysis.server.protocol.TypeHierarchyItem.fromJsonArray ( JsonArray  jsonArray)
inlinestatic

Definition at line 121 of file TypeHierarchyItem.java.

121 {
122 if (jsonArray == null) {
123 return EMPTY_LIST;
124 }
125 ArrayList<TypeHierarchyItem> list = new ArrayList<TypeHierarchyItem>(jsonArray.size());
126 Iterator<JsonElement> iterator = jsonArray.iterator();
127 while (iterator.hasNext()) {
128 list.add(fromJson(iterator.next().getAsJsonObject()));
129 }
130 return list;
131 }
static TypeHierarchyItem fromJson(JsonObject jsonObject)

◆ getBestName()

String org.dartlang.analysis.server.protocol.TypeHierarchyItem.getBestName ( )
inline

Definition at line 133 of file TypeHierarchyItem.java.

133 {
134 if (displayName == null) {
135 return classElement.getName();
136 } else {
137 return displayName;
138 }
139 }

◆ getClassElement()

Element org.dartlang.analysis.server.protocol.TypeHierarchyItem.getClassElement ( )
inline

The class element represented by this item.

Definition at line 144 of file TypeHierarchyItem.java.

144 {
145 return classElement;
146 }

◆ getDisplayName()

String org.dartlang.analysis.server.protocol.TypeHierarchyItem.getDisplayName ( )
inline

The name to be displayed for the class. This field will be omitted if the display name is the same as the name of the element. The display name is different if there is additional type information to be displayed, such as type arguments.

Definition at line 153 of file TypeHierarchyItem.java.

153 {
154 return displayName;
155 }

◆ getInterfaces()

int[] org.dartlang.analysis.server.protocol.TypeHierarchyItem.getInterfaces ( )
inline

The indexes of the items representing the interfaces implemented by this class. The list will be empty if there are no implemented interfaces.

Definition at line 161 of file TypeHierarchyItem.java.

161 {
162 return interfaces;
163 }

◆ getMemberElement()

Element org.dartlang.analysis.server.protocol.TypeHierarchyItem.getMemberElement ( )
inline

The member in the class corresponding to the member on which the hierarchy was requested. This field will be omitted if the hierarchy was not requested for a member or if the class does not have a corresponding member.

Definition at line 170 of file TypeHierarchyItem.java.

170 {
171 return memberElement;
172 }

◆ getMixins()

int[] org.dartlang.analysis.server.protocol.TypeHierarchyItem.getMixins ( )
inline

The indexes of the items representing the mixins referenced by this class. The list will be empty if there are no classes mixed into this class.

Definition at line 178 of file TypeHierarchyItem.java.

178 {
179 return mixins;
180 }

◆ getSubclasses()

int[] org.dartlang.analysis.server.protocol.TypeHierarchyItem.getSubclasses ( )
inline

The indexes of the items representing the subtypes of this class. The list will be empty if there are no subtypes or if this item represents a supertype of the pivot type.

Definition at line 186 of file TypeHierarchyItem.java.

186 {
187 return subclasses;
188 }

◆ getSuperclass()

Integer org.dartlang.analysis.server.protocol.TypeHierarchyItem.getSuperclass ( )
inline

The index of the item representing the superclass of this class. This field will be omitted if this item represents the class Object.

Definition at line 194 of file TypeHierarchyItem.java.

194 {
195 return superclass;
196 }

◆ hashCode()

int org.dartlang.analysis.server.protocol.TypeHierarchyItem.hashCode ( )
inline

Definition at line 199 of file TypeHierarchyItem.java.

199 {
200 HashCodeBuilder builder = new HashCodeBuilder();
201 builder.append(classElement);
202 builder.append(displayName);
203 builder.append(memberElement);
204 builder.append(superclass);
205 builder.append(interfaces);
206 builder.append(mixins);
207 builder.append(subclasses);
208 return builder.toHashCode();
209 }

◆ toJson()

JsonObject org.dartlang.analysis.server.protocol.TypeHierarchyItem.toJson ( )
inline

Definition at line 211 of file TypeHierarchyItem.java.

211 {
212 JsonObject jsonObject = new JsonObject();
213 jsonObject.add("classElement", classElement.toJson());
214 if (displayName != null) {
215 jsonObject.addProperty("displayName", displayName);
216 }
217 if (memberElement != null) {
218 jsonObject.add("memberElement", memberElement.toJson());
219 }
220 if (superclass != null) {
221 jsonObject.addProperty("superclass", superclass);
222 }
223 JsonArray jsonArrayInterfaces = new JsonArray();
224 for (int elt : interfaces) {
225 jsonArrayInterfaces.add(new JsonPrimitive(elt));
226 }
227 jsonObject.add("interfaces", jsonArrayInterfaces);
228 JsonArray jsonArrayMixins = new JsonArray();
229 for (int elt : mixins) {
230 jsonArrayMixins.add(new JsonPrimitive(elt));
231 }
232 jsonObject.add("mixins", jsonArrayMixins);
233 JsonArray jsonArraySubclasses = new JsonArray();
234 for (int elt : subclasses) {
235 jsonArraySubclasses.add(new JsonPrimitive(elt));
236 }
237 jsonObject.add("subclasses", jsonArraySubclasses);
238 return jsonObject;
239 }

◆ toString()

String org.dartlang.analysis.server.protocol.TypeHierarchyItem.toString ( )
inline

Definition at line 242 of file TypeHierarchyItem.java.

242 {
243 StringBuilder builder = new StringBuilder();
244 builder.append("[");
245 builder.append("classElement=");
246 builder.append(classElement + ", ");
247 builder.append("displayName=");
248 builder.append(displayName + ", ");
249 builder.append("memberElement=");
250 builder.append(memberElement + ", ");
251 builder.append("superclass=");
252 builder.append(superclass + ", ");
253 builder.append("interfaces=");
254 builder.append(StringUtils.join(interfaces, ", ") + ", ");
255 builder.append("mixins=");
256 builder.append(StringUtils.join(mixins, ", ") + ", ");
257 builder.append("subclasses=");
258 builder.append(StringUtils.join(subclasses, ", "));
259 builder.append("]");
260 return builder.toString();
261 }

Member Data Documentation

◆ EMPTY_ARRAY

final TypeHierarchyItem [] org.dartlang.analysis.server.protocol.TypeHierarchyItem.EMPTY_ARRAY = new TypeHierarchyItem[0]
static

Definition at line 34 of file TypeHierarchyItem.java.

◆ EMPTY_LIST

final List<TypeHierarchyItem> org.dartlang.analysis.server.protocol.TypeHierarchyItem.EMPTY_LIST = Lists.newArrayList()
static

Definition at line 36 of file TypeHierarchyItem.java.


The documentation for this class was generated from the following file: