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

Public Member Functions

 RuntimeCompletionExpression (int offset, int length, RuntimeCompletionExpressionType type)
 
boolean equals (Object obj)
 
int getLength ()
 
int getOffset ()
 
RuntimeCompletionExpressionType getType ()
 
int hashCode ()
 
JsonObject toJson ()
 
String toString ()
 

Static Public Member Functions

static RuntimeCompletionExpression fromJson (JsonObject jsonObject)
 
static List< RuntimeCompletionExpressionfromJsonArray (JsonArray jsonArray)
 

Static Public Attributes

static final RuntimeCompletionExpression[] EMPTY_ARRAY = new RuntimeCompletionExpression[0]
 
static final List< RuntimeCompletionExpressionEMPTY_LIST = Lists.newArrayList()
 

Detailed Description

An expression for which we want to know its runtime type. In expressions like 'a.b.c.where((e) => e.^)' we want to know the runtime type of 'a.b.c' to enforce it statically at the time when we compute completion suggestions, and get better type for 'e'.

@coverage dart.server.generated.types

Definition at line 34 of file RuntimeCompletionExpression.java.

Constructor & Destructor Documentation

◆ RuntimeCompletionExpression()

org.dartlang.analysis.server.protocol.RuntimeCompletionExpression.RuntimeCompletionExpression ( int  offset,
int  length,
RuntimeCompletionExpressionType  type 
)
inline

Constructor for RuntimeCompletionExpression.

Definition at line 59 of file RuntimeCompletionExpression.java.

59 {
60 this.offset = offset;
61 this.length = length;
62 this.type = type;
63 }

Member Function Documentation

◆ equals()

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

Definition at line 66 of file RuntimeCompletionExpression.java.

66 {
67 if (obj instanceof RuntimeCompletionExpression) {
68 RuntimeCompletionExpression other = (RuntimeCompletionExpression) obj;
69 return
70 other.offset == offset &&
71 other.length == length &&
72 ObjectUtilities.equals(other.type, type);
73 }
74 return false;
75 }

◆ fromJson()

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

Definition at line 77 of file RuntimeCompletionExpression.java.

77 {
78 int offset = jsonObject.get("offset").getAsInt();
79 int length = jsonObject.get("length").getAsInt();
80 RuntimeCompletionExpressionType type = jsonObject.get("type") == null ? null : RuntimeCompletionExpressionType.fromJson(jsonObject.get("type").getAsJsonObject());
81 return new RuntimeCompletionExpression(offset, length, type);
82 }
static RuntimeCompletionExpressionType fromJson(JsonObject jsonObject)
RuntimeCompletionExpression(int offset, int length, RuntimeCompletionExpressionType type)

◆ fromJsonArray()

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

Definition at line 84 of file RuntimeCompletionExpression.java.

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

◆ getLength()

int org.dartlang.analysis.server.protocol.RuntimeCompletionExpression.getLength ( )
inline

The length of the expression in the code for completion.

Definition at line 99 of file RuntimeCompletionExpression.java.

99 {
100 return length;
101 }

◆ getOffset()

int org.dartlang.analysis.server.protocol.RuntimeCompletionExpression.getOffset ( )
inline

The offset of the expression in the code for completion.

Definition at line 106 of file RuntimeCompletionExpression.java.

106 {
107 return offset;
108 }

◆ getType()

RuntimeCompletionExpressionType org.dartlang.analysis.server.protocol.RuntimeCompletionExpression.getType ( )
inline

When the expression is sent from the server to the client, the type is omitted. The client should fill the type when it sends the request to the server again.

Definition at line 114 of file RuntimeCompletionExpression.java.

114 {
115 return type;
116 }

◆ hashCode()

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

Definition at line 119 of file RuntimeCompletionExpression.java.

119 {
120 HashCodeBuilder builder = new HashCodeBuilder();
121 builder.append(offset);
122 builder.append(length);
123 builder.append(type);
124 return builder.toHashCode();
125 }

◆ toJson()

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

Definition at line 127 of file RuntimeCompletionExpression.java.

127 {
128 JsonObject jsonObject = new JsonObject();
129 jsonObject.addProperty("offset", offset);
130 jsonObject.addProperty("length", length);
131 if (type != null) {
132 jsonObject.add("type", type.toJson());
133 }
134 return jsonObject;
135 }

◆ toString()

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

Definition at line 138 of file RuntimeCompletionExpression.java.

138 {
139 StringBuilder builder = new StringBuilder();
140 builder.append("[");
141 builder.append("offset=");
142 builder.append(offset + ", ");
143 builder.append("length=");
144 builder.append(length + ", ");
145 builder.append("type=");
146 builder.append(type);
147 builder.append("]");
148 return builder.toString();
149 }

Member Data Documentation

◆ EMPTY_ARRAY

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

Definition at line 36 of file RuntimeCompletionExpression.java.

◆ EMPTY_LIST

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

Definition at line 38 of file RuntimeCompletionExpression.java.


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