Flutter Engine
The Flutter Engine
Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
org.dartlang.analysis.server.protocol.ExtractLocalVariableFeedback Class Reference
Inheritance diagram for org.dartlang.analysis.server.protocol.ExtractLocalVariableFeedback:
org.dartlang.analysis.server.protocol.RefactoringFeedback

Public Member Functions

 ExtractLocalVariableFeedback (int[] coveringExpressionOffsets, int[] coveringExpressionLengths, List< String > names, int[] offsets, int[] lengths)
 
boolean equals (Object obj)
 
int[] getCoveringExpressionLengths ()
 
int[] getCoveringExpressionOffsets ()
 
int[] getLengths ()
 
List< String > getNames ()
 
int[] getOffsets ()
 
int hashCode ()
 
JsonObject toJson ()
 
String toString ()
 
- Public Member Functions inherited from org.dartlang.analysis.server.protocol.RefactoringFeedback
 RefactoringFeedback ()
 
boolean equals (Object obj)
 
int hashCode ()
 
JsonObject toJson ()
 
String toString ()
 

Static Public Member Functions

static ExtractLocalVariableFeedback fromJson (JsonObject jsonObject)
 
static List< ExtractLocalVariableFeedbackfromJsonArray (JsonArray jsonArray)
 
static RefactoringFeedback fromJson (JsonObject jsonObject)
 

Static Public Attributes

static final ExtractLocalVariableFeedback[] EMPTY_ARRAY = new ExtractLocalVariableFeedback[0]
 
static final List< ExtractLocalVariableFeedbackEMPTY_LIST = Lists.newArrayList()
 
- Static Public Attributes inherited from org.dartlang.analysis.server.protocol.RefactoringFeedback
static final RefactoringFeedback[] EMPTY_ARRAY = new RefactoringFeedback[0]
 
static final List< RefactoringFeedbackEMPTY_LIST = Lists.newArrayList()
 

Detailed Description

@coverage dart.server.generated.types

Definition at line 30 of file ExtractLocalVariableFeedback.java.

Constructor & Destructor Documentation

◆ ExtractLocalVariableFeedback()

org.dartlang.analysis.server.protocol.ExtractLocalVariableFeedback.ExtractLocalVariableFeedback ( int[]  coveringExpressionOffsets,
int[]  coveringExpressionLengths,
List< String >  names,
int[]  offsets,
int[]  lengths 
)
inline

Constructor for ExtractLocalVariableFeedback.

Definition at line 68 of file ExtractLocalVariableFeedback.java.

68 {
69 this.coveringExpressionOffsets = coveringExpressionOffsets;
70 this.coveringExpressionLengths = coveringExpressionLengths;
71 this.names = names;
72 this.offsets = offsets;
73 this.lengths = lengths;
74 }

Member Function Documentation

◆ equals()

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

Reimplemented from org.dartlang.analysis.server.protocol.RefactoringFeedback.

Definition at line 77 of file ExtractLocalVariableFeedback.java.

77 {
78 if (obj instanceof ExtractLocalVariableFeedback) {
80 return
81 Arrays.equals(other.coveringExpressionOffsets, coveringExpressionOffsets) &&
82 Arrays.equals(other.coveringExpressionLengths, coveringExpressionLengths) &&
83 ObjectUtilities.equals(other.names, names) &&
84 Arrays.equals(other.offsets, offsets) &&
85 Arrays.equals(other.lengths, lengths);
86 }
87 return false;
88 }
ExtractLocalVariableFeedback(int[] coveringExpressionOffsets, int[] coveringExpressionLengths, List< String > names, int[] offsets, int[] lengths)

◆ fromJson()

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

Reimplemented from org.dartlang.analysis.server.protocol.RefactoringFeedback.

Definition at line 90 of file ExtractLocalVariableFeedback.java.

90 {
91 int[] coveringExpressionOffsets = jsonObject.get("coveringExpressionOffsets") == null ? null : JsonUtilities.decodeIntArray(jsonObject.get("coveringExpressionOffsets").getAsJsonArray());
92 int[] coveringExpressionLengths = jsonObject.get("coveringExpressionLengths") == null ? null : JsonUtilities.decodeIntArray(jsonObject.get("coveringExpressionLengths").getAsJsonArray());
93 List<String> names = JsonUtilities.decodeStringList(jsonObject.get("names").getAsJsonArray());
94 int[] offsets = JsonUtilities.decodeIntArray(jsonObject.get("offsets").getAsJsonArray());
95 int[] lengths = JsonUtilities.decodeIntArray(jsonObject.get("lengths").getAsJsonArray());
96 return new ExtractLocalVariableFeedback(coveringExpressionOffsets, coveringExpressionLengths, names, offsets, lengths);
97 }

◆ fromJsonArray()

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

Definition at line 99 of file ExtractLocalVariableFeedback.java.

99 {
100 if (jsonArray == null) {
101 return EMPTY_LIST;
102 }
103 ArrayList<ExtractLocalVariableFeedback> list = new ArrayList<ExtractLocalVariableFeedback>(jsonArray.size());
104 Iterator<JsonElement> iterator = jsonArray.iterator();
105 while (iterator.hasNext()) {
106 list.add(fromJson(iterator.next().getAsJsonObject()));
107 }
108 return list;
109 }
static ExtractLocalVariableFeedback fromJson(JsonObject jsonObject)

◆ getCoveringExpressionLengths()

int[] org.dartlang.analysis.server.protocol.ExtractLocalVariableFeedback.getCoveringExpressionLengths ( )
inline

The lengths of the expressions that cover the specified selection, from the down most to the up most.

Definition at line 115 of file ExtractLocalVariableFeedback.java.

115 {
116 return coveringExpressionLengths;
117 }

◆ getCoveringExpressionOffsets()

int[] org.dartlang.analysis.server.protocol.ExtractLocalVariableFeedback.getCoveringExpressionOffsets ( )
inline

The offsets of the expressions that cover the specified selection, from the down most to the up most.

Definition at line 123 of file ExtractLocalVariableFeedback.java.

123 {
124 return coveringExpressionOffsets;
125 }

◆ getLengths()

int[] org.dartlang.analysis.server.protocol.ExtractLocalVariableFeedback.getLengths ( )
inline

The lengths of the expressions that would be replaced by a reference to the variable. The lengths correspond to the offsets. In other words, for a given expression, if the offset of that expression is offsets[i], then the length of that expression is lengths[i].

Definition at line 132 of file ExtractLocalVariableFeedback.java.

132 {
133 return lengths;
134 }

◆ getNames()

List< String > org.dartlang.analysis.server.protocol.ExtractLocalVariableFeedback.getNames ( )
inline

The proposed names for the local variable.

Definition at line 139 of file ExtractLocalVariableFeedback.java.

139 {
140 return names;
141 }

◆ getOffsets()

int[] org.dartlang.analysis.server.protocol.ExtractLocalVariableFeedback.getOffsets ( )
inline

The offsets of the expressions that would be replaced by a reference to the variable.

Definition at line 146 of file ExtractLocalVariableFeedback.java.

146 {
147 return offsets;
148 }

◆ hashCode()

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

Reimplemented from org.dartlang.analysis.server.protocol.RefactoringFeedback.

Definition at line 151 of file ExtractLocalVariableFeedback.java.

151 {
152 HashCodeBuilder builder = new HashCodeBuilder();
153 builder.append(coveringExpressionOffsets);
154 builder.append(coveringExpressionLengths);
155 builder.append(names);
156 builder.append(offsets);
157 builder.append(lengths);
158 return builder.toHashCode();
159 }

◆ toJson()

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

Reimplemented from org.dartlang.analysis.server.protocol.RefactoringFeedback.

Definition at line 161 of file ExtractLocalVariableFeedback.java.

161 {
162 JsonObject jsonObject = new JsonObject();
163 if (coveringExpressionOffsets != null) {
164 JsonArray jsonArrayCoveringExpressionOffsets = new JsonArray();
165 for (int elt : coveringExpressionOffsets) {
166 jsonArrayCoveringExpressionOffsets.add(new JsonPrimitive(elt));
167 }
168 jsonObject.add("coveringExpressionOffsets", jsonArrayCoveringExpressionOffsets);
169 }
170 if (coveringExpressionLengths != null) {
171 JsonArray jsonArrayCoveringExpressionLengths = new JsonArray();
172 for (int elt : coveringExpressionLengths) {
173 jsonArrayCoveringExpressionLengths.add(new JsonPrimitive(elt));
174 }
175 jsonObject.add("coveringExpressionLengths", jsonArrayCoveringExpressionLengths);
176 }
177 JsonArray jsonArrayNames = new JsonArray();
178 for (String elt : names) {
179 jsonArrayNames.add(new JsonPrimitive(elt));
180 }
181 jsonObject.add("names", jsonArrayNames);
182 JsonArray jsonArrayOffsets = new JsonArray();
183 for (int elt : offsets) {
184 jsonArrayOffsets.add(new JsonPrimitive(elt));
185 }
186 jsonObject.add("offsets", jsonArrayOffsets);
187 JsonArray jsonArrayLengths = new JsonArray();
188 for (int elt : lengths) {
189 jsonArrayLengths.add(new JsonPrimitive(elt));
190 }
191 jsonObject.add("lengths", jsonArrayLengths);
192 return jsonObject;
193 }

◆ toString()

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

Reimplemented from org.dartlang.analysis.server.protocol.RefactoringFeedback.

Definition at line 196 of file ExtractLocalVariableFeedback.java.

196 {
197 StringBuilder builder = new StringBuilder();
198 builder.append("[");
199 builder.append("coveringExpressionOffsets=");
200 builder.append(StringUtils.join(coveringExpressionOffsets, ", ") + ", ");
201 builder.append("coveringExpressionLengths=");
202 builder.append(StringUtils.join(coveringExpressionLengths, ", ") + ", ");
203 builder.append("names=");
204 builder.append(StringUtils.join(names, ", ") + ", ");
205 builder.append("offsets=");
206 builder.append(StringUtils.join(offsets, ", ") + ", ");
207 builder.append("lengths=");
208 builder.append(StringUtils.join(lengths, ", "));
209 builder.append("]");
210 return builder.toString();
211 }

Member Data Documentation

◆ EMPTY_ARRAY

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

Definition at line 32 of file ExtractLocalVariableFeedback.java.

◆ EMPTY_LIST

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

Definition at line 34 of file ExtractLocalVariableFeedback.java.


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