Flutter Engine
The Flutter Engine
Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
org.dartlang.analysis.server.protocol.NavigationTarget Class Reference

Public Member Functions

 NavigationTarget (String kind, int fileIndex, int offset, int length, int startLine, int startColumn, Integer codeOffset, Integer codeLength)
 
boolean equals (Object obj)
 
String getFile ()
 
Integer getCodeLength ()
 
Integer getCodeOffset ()
 
int getFileIndex ()
 
String getKind ()
 
int getLength ()
 
int getOffset ()
 
int getStartColumn ()
 
int getStartLine ()
 
int hashCode ()
 
void lookupFile (String[] allTargetFiles)
 
JsonObject toJson ()
 
String toString ()
 

Static Public Member Functions

static NavigationTarget fromJson (JsonObject jsonObject)
 
static List< NavigationTargetfromJsonArray (JsonArray jsonArray)
 

Static Public Attributes

static final NavigationTarget[] EMPTY_ARRAY = new NavigationTarget[0]
 
static final List< NavigationTargetEMPTY_LIST = Lists.newArrayList()
 

Detailed Description

A description of a target to which the user can navigate.

@coverage dart.server.generated.types

Definition at line 32 of file NavigationTarget.java.

Constructor & Destructor Documentation

◆ NavigationTarget()

org.dartlang.analysis.server.protocol.NavigationTarget.NavigationTarget ( String  kind,
int  fileIndex,
int  offset,
int  length,
int  startLine,
int  startColumn,
Integer  codeOffset,
Integer  codeLength 
)
inline

Constructor for NavigationTarget.

Definition at line 83 of file NavigationTarget.java.

83 {
84 this.kind = kind;
85 this.fileIndex = fileIndex;
86 this.offset = offset;
87 this.length = length;
88 this.startLine = startLine;
89 this.startColumn = startColumn;
90 this.codeOffset = codeOffset;
91 this.codeLength = codeLength;
92 }

Member Function Documentation

◆ equals()

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

Definition at line 95 of file NavigationTarget.java.

95 {
96 if (obj instanceof NavigationTarget) {
98 return
99 ObjectUtilities.equals(other.kind, kind) &&
100 other.fileIndex == fileIndex &&
101 other.offset == offset &&
102 other.length == length &&
103 other.startLine == startLine &&
104 other.startColumn == startColumn &&
105 ObjectUtilities.equals(other.codeOffset, codeOffset) &&
106 ObjectUtilities.equals(other.codeLength, codeLength);
107 }
108 return false;
109 }
NavigationTarget(String kind, int fileIndex, int offset, int length, int startLine, int startColumn, Integer codeOffset, Integer codeLength)

◆ fromJson()

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

Definition at line 111 of file NavigationTarget.java.

111 {
112 String kind = jsonObject.get("kind").getAsString();
113 int fileIndex = jsonObject.get("fileIndex").getAsInt();
114 int offset = jsonObject.get("offset").getAsInt();
115 int length = jsonObject.get("length").getAsInt();
116 int startLine = jsonObject.get("startLine").getAsInt();
117 int startColumn = jsonObject.get("startColumn").getAsInt();
118 Integer codeOffset = jsonObject.get("codeOffset") == null ? null : jsonObject.get("codeOffset").getAsInt();
119 Integer codeLength = jsonObject.get("codeLength") == null ? null : jsonObject.get("codeLength").getAsInt();
120 return new NavigationTarget(kind, fileIndex, offset, length, startLine, startColumn, codeOffset, codeLength);
121 }

◆ fromJsonArray()

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

Definition at line 123 of file NavigationTarget.java.

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

◆ getCodeLength()

Integer org.dartlang.analysis.server.protocol.NavigationTarget.getCodeLength ( )
inline

The length of the target code to which the user can navigate.

Definition at line 142 of file NavigationTarget.java.

142 {
143 return codeLength;
144 }

◆ getCodeOffset()

Integer org.dartlang.analysis.server.protocol.NavigationTarget.getCodeOffset ( )
inline

The offset of the target code to which the user can navigate.

Definition at line 149 of file NavigationTarget.java.

149 {
150 return codeOffset;
151 }

◆ getFile()

String org.dartlang.analysis.server.protocol.NavigationTarget.getFile ( )
inline

Definition at line 135 of file NavigationTarget.java.

135 {
136 return file;
137 }

◆ getFileIndex()

int org.dartlang.analysis.server.protocol.NavigationTarget.getFileIndex ( )
inline

The index of the file (in the enclosing navigation response) to navigate to.

Definition at line 156 of file NavigationTarget.java.

156 {
157 return fileIndex;
158 }

◆ getKind()

String org.dartlang.analysis.server.protocol.NavigationTarget.getKind ( )
inline

The kind of the element.

Definition at line 163 of file NavigationTarget.java.

163 {
164 return kind;
165 }

◆ getLength()

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

The length of the name of the target to which the user can navigate.

Definition at line 170 of file NavigationTarget.java.

170 {
171 return length;
172 }

◆ getOffset()

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

The offset of the name of the target to which the user can navigate.

Definition at line 177 of file NavigationTarget.java.

177 {
178 return offset;
179 }

◆ getStartColumn()

int org.dartlang.analysis.server.protocol.NavigationTarget.getStartColumn ( )
inline

The one-based index of the column containing the first character of the name of the target.

Definition at line 184 of file NavigationTarget.java.

184 {
185 return startColumn;
186 }

◆ getStartLine()

int org.dartlang.analysis.server.protocol.NavigationTarget.getStartLine ( )
inline

The one-based index of the line containing the first character of the name of the target.

Definition at line 191 of file NavigationTarget.java.

191 {
192 return startLine;
193 }

◆ hashCode()

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

Definition at line 196 of file NavigationTarget.java.

196 {
197 HashCodeBuilder builder = new HashCodeBuilder();
198 builder.append(kind);
199 builder.append(fileIndex);
200 builder.append(offset);
201 builder.append(length);
202 builder.append(startLine);
203 builder.append(startColumn);
204 builder.append(codeOffset);
205 builder.append(codeLength);
206 return builder.toHashCode();
207 }

◆ lookupFile()

void org.dartlang.analysis.server.protocol.NavigationTarget.lookupFile ( String[]  allTargetFiles)
inline

Definition at line 209 of file NavigationTarget.java.

209 {
210 file = allTargetFiles[fileIndex];
211 }

◆ toJson()

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

Definition at line 213 of file NavigationTarget.java.

213 {
214 JsonObject jsonObject = new JsonObject();
215 jsonObject.addProperty("kind", kind);
216 jsonObject.addProperty("fileIndex", fileIndex);
217 jsonObject.addProperty("offset", offset);
218 jsonObject.addProperty("length", length);
219 jsonObject.addProperty("startLine", startLine);
220 jsonObject.addProperty("startColumn", startColumn);
221 if (codeOffset != null) {
222 jsonObject.addProperty("codeOffset", codeOffset);
223 }
224 if (codeLength != null) {
225 jsonObject.addProperty("codeLength", codeLength);
226 }
227 return jsonObject;
228 }

◆ toString()

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

Definition at line 231 of file NavigationTarget.java.

231 {
232 StringBuilder builder = new StringBuilder();
233 builder.append("[");
234 builder.append("kind=");
235 builder.append(kind + ", ");
236 builder.append("fileIndex=");
237 builder.append(fileIndex + ", ");
238 builder.append("offset=");
239 builder.append(offset + ", ");
240 builder.append("length=");
241 builder.append(length + ", ");
242 builder.append("startLine=");
243 builder.append(startLine + ", ");
244 builder.append("startColumn=");
245 builder.append(startColumn + ", ");
246 builder.append("codeOffset=");
247 builder.append(codeOffset + ", ");
248 builder.append("codeLength=");
249 builder.append(codeLength);
250 builder.append("]");
251 return builder.toString();
252 }

Member Data Documentation

◆ EMPTY_ARRAY

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

Definition at line 34 of file NavigationTarget.java.

◆ EMPTY_LIST

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

Definition at line 36 of file NavigationTarget.java.


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