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.ImportedElementSet Class Reference

Public Member Functions

 ImportedElementSet (List< String > strings, int[] uris, int[] names)
 
boolean equals (Object obj)
 
int[] getNames ()
 
List< String > getStrings ()
 
int[] getUris ()
 
int hashCode ()
 
JsonObject toJson ()
 
String toString ()
 

Static Public Member Functions

static ImportedElementSet fromJson (JsonObject jsonObject)
 
static List< ImportedElementSetfromJsonArray (JsonArray jsonArray)
 

Static Public Attributes

static final ImportedElementSet[] EMPTY_ARRAY = new ImportedElementSet[0]
 
static final List< ImportedElementSetEMPTY_LIST = Lists.newArrayList()
 

Detailed Description

The set of top-level elements encoded as pairs of the defining library URI and the name, and stored in the parallel lists elementUris and elementNames.

@coverage dart.server.generated.types

Definition at line 33 of file ImportedElementSet.java.

Constructor & Destructor Documentation

◆ ImportedElementSet()

org.dartlang.analysis.server.protocol.ImportedElementSet.ImportedElementSet ( List< String >  strings,
int[]  uris,
int[]  names 
)
inline

Constructor for ImportedElementSet.

Definition at line 57 of file ImportedElementSet.java.

57 {
58 this.strings = strings;
59 this.uris = uris;
60 this.names = names;
61 }

Member Function Documentation

◆ equals()

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

Definition at line 64 of file ImportedElementSet.java.

64 {
65 if (obj instanceof ImportedElementSet) {
66 ImportedElementSet other = (ImportedElementSet) obj;
67 return
68 ObjectUtilities.equals(other.strings, strings) &&
69 Arrays.equals(other.uris, uris) &&
70 Arrays.equals(other.names, names);
71 }
72 return false;
73 }

◆ fromJson()

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

Definition at line 75 of file ImportedElementSet.java.

75 {
76 List<String> strings = JsonUtilities.decodeStringList(jsonObject.get("strings").getAsJsonArray());
77 int[] uris = JsonUtilities.decodeIntArray(jsonObject.get("uris").getAsJsonArray());
78 int[] names = JsonUtilities.decodeIntArray(jsonObject.get("names").getAsJsonArray());
79 return new ImportedElementSet(strings, uris, names);
80 }
ImportedElementSet(List< String > strings, int[] uris, int[] names)

◆ fromJsonArray()

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

Definition at line 82 of file ImportedElementSet.java.

82 {
83 if (jsonArray == null) {
84 return EMPTY_LIST;
85 }
86 ArrayList<ImportedElementSet> list = new ArrayList<ImportedElementSet>(jsonArray.size());
87 Iterator<JsonElement> iterator = jsonArray.iterator();
88 while (iterator.hasNext()) {
89 list.add(fromJson(iterator.next().getAsJsonObject()));
90 }
91 return list;
92 }
static ImportedElementSet fromJson(JsonObject jsonObject)

◆ getNames()

int[] org.dartlang.analysis.server.protocol.ImportedElementSet.getNames ( )
inline

The name part of a the element. It is an index in the strings field.

Definition at line 97 of file ImportedElementSet.java.

97 {
98 return names;
99 }

◆ getStrings()

List< String > org.dartlang.analysis.server.protocol.ImportedElementSet.getStrings ( )
inline

The list of unique strings in this object.

Definition at line 104 of file ImportedElementSet.java.

104 {
105 return strings;
106 }

◆ getUris()

int[] org.dartlang.analysis.server.protocol.ImportedElementSet.getUris ( )
inline

The library URI part of the element. It is an index in the strings field.

Definition at line 111 of file ImportedElementSet.java.

111 {
112 return uris;
113 }

◆ hashCode()

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

Definition at line 116 of file ImportedElementSet.java.

116 {
117 HashCodeBuilder builder = new HashCodeBuilder();
118 builder.append(strings);
119 builder.append(uris);
120 builder.append(names);
121 return builder.toHashCode();
122 }

◆ toJson()

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

Definition at line 124 of file ImportedElementSet.java.

124 {
125 JsonObject jsonObject = new JsonObject();
126 JsonArray jsonArrayStrings = new JsonArray();
127 for (String elt : strings) {
128 jsonArrayStrings.add(new JsonPrimitive(elt));
129 }
130 jsonObject.add("strings", jsonArrayStrings);
131 JsonArray jsonArrayUris = new JsonArray();
132 for (int elt : uris) {
133 jsonArrayUris.add(new JsonPrimitive(elt));
134 }
135 jsonObject.add("uris", jsonArrayUris);
136 JsonArray jsonArrayNames = new JsonArray();
137 for (int elt : names) {
138 jsonArrayNames.add(new JsonPrimitive(elt));
139 }
140 jsonObject.add("names", jsonArrayNames);
141 return jsonObject;
142 }

◆ toString()

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

Definition at line 145 of file ImportedElementSet.java.

145 {
146 StringBuilder builder = new StringBuilder();
147 builder.append("[");
148 builder.append("strings=");
149 builder.append(StringUtils.join(strings, ", ") + ", ");
150 builder.append("uris=");
151 builder.append(StringUtils.join(uris, ", ") + ", ");
152 builder.append("names=");
153 builder.append(StringUtils.join(names, ", "));
154 builder.append("]");
155 return builder.toString();
156 }

Member Data Documentation

◆ EMPTY_ARRAY

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

Definition at line 35 of file ImportedElementSet.java.

◆ EMPTY_LIST

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

Definition at line 37 of file ImportedElementSet.java.


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