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

Public Member Functions

 SearchResult (Location location, String kind, boolean isPotential, List< Element > path)
 
boolean equals (Object obj)
 
boolean isPotential ()
 
String getKind ()
 
Location getLocation ()
 
List< ElementgetPath ()
 
int hashCode ()
 
JsonObject toJson ()
 
String toString ()
 

Static Public Member Functions

static SearchResult fromJson (JsonObject jsonObject)
 
static List< SearchResultfromJsonArray (JsonArray jsonArray)
 

Static Public Attributes

static final SearchResult[] EMPTY_ARRAY = new SearchResult[0]
 
static final List< SearchResultEMPTY_LIST = Lists.newArrayList()
 

Detailed Description

A single result from a search request.

@coverage dart.server.generated.types

Definition at line 32 of file SearchResult.java.

Constructor & Destructor Documentation

◆ SearchResult()

org.dartlang.analysis.server.protocol.SearchResult.SearchResult ( Location  location,
String  kind,
boolean  isPotential,
List< Element path 
)
inline

Constructor for SearchResult.

Definition at line 64 of file SearchResult.java.

64 {
65 this.location = location;
66 this.kind = kind;
67 this.isPotential = isPotential;
68 this.path = path;
69 }
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir path
Definition: switches.h:57

Member Function Documentation

◆ equals()

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

Definition at line 72 of file SearchResult.java.

72 {
73 if (obj instanceof SearchResult) {
74 SearchResult other = (SearchResult) obj;
75 return
76 ObjectUtilities.equals(other.location, location) &&
77 ObjectUtilities.equals(other.kind, kind) &&
78 other.isPotential == isPotential &&
79 ObjectUtilities.equals(other.path, path);
80 }
81 return false;
82 }
SearchResult(Location location, String kind, boolean isPotential, List< Element > path)

◆ fromJson()

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

Definition at line 84 of file SearchResult.java.

84 {
85 Location location = Location.fromJson(jsonObject.get("location").getAsJsonObject());
86 String kind = jsonObject.get("kind").getAsString();
87 boolean isPotential = jsonObject.get("isPotential").getAsBoolean();
88 List<Element> path = Element.fromJsonArray(jsonObject.get("path").getAsJsonArray());
89 return new SearchResult(location, kind, isPotential, path);
90 }
static Location fromJson(JsonObject jsonObject)
Definition: Location.java:102
Definition: dart.idl:42

◆ fromJsonArray()

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

Definition at line 92 of file SearchResult.java.

92 {
93 if (jsonArray == null) {
94 return EMPTY_LIST;
95 }
96 ArrayList<SearchResult> list = new ArrayList<SearchResult>(jsonArray.size());
97 Iterator<JsonElement> iterator = jsonArray.iterator();
98 while (iterator.hasNext()) {
99 list.add(fromJson(iterator.next().getAsJsonObject()));
100 }
101 return list;
102 }
static final List< SearchResult > EMPTY_LIST
static SearchResult fromJson(JsonObject jsonObject)

◆ getKind()

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

The kind of element that was found or the kind of reference that was found.

Definition at line 116 of file SearchResult.java.

116 {
117 return kind;
118 }

◆ getLocation()

Location org.dartlang.analysis.server.protocol.SearchResult.getLocation ( )
inline

The location of the code that matched the search criteria.

Definition at line 123 of file SearchResult.java.

123 {
124 return location;
125 }

◆ getPath()

List< Element > org.dartlang.analysis.server.protocol.SearchResult.getPath ( )
inline

The elements that contain the result, starting with the most immediately enclosing ancestor and ending with the library.

Definition at line 131 of file SearchResult.java.

131 {
132 return path;
133 }

◆ hashCode()

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

Definition at line 136 of file SearchResult.java.

136 {
137 HashCodeBuilder builder = new HashCodeBuilder();
138 builder.append(location);
139 builder.append(kind);
140 builder.append(isPotential);
141 builder.append(path);
142 return builder.toHashCode();
143 }

◆ isPotential()

boolean org.dartlang.analysis.server.protocol.SearchResult.isPotential ( )
inline

True if the result is a potential match but cannot be confirmed to be a match. For example, if all references to a method m defined in some class were requested, and a reference to a method m from an unknown class were found, it would be marked as being a potential match.

Definition at line 109 of file SearchResult.java.

109 {
110 return isPotential;
111 }

◆ toJson()

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

Definition at line 145 of file SearchResult.java.

145 {
146 JsonObject jsonObject = new JsonObject();
147 jsonObject.add("location", location.toJson());
148 jsonObject.addProperty("kind", kind);
149 jsonObject.addProperty("isPotential", isPotential);
150 JsonArray jsonArrayPath = new JsonArray();
151 for (Element elt : path) {
152 jsonArrayPath.add(elt.toJson());
153 }
154 jsonObject.add("path", jsonArrayPath);
155 return jsonObject;
156 }

◆ toString()

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

Definition at line 159 of file SearchResult.java.

159 {
160 StringBuilder builder = new StringBuilder();
161 builder.append("[");
162 builder.append("location=");
163 builder.append(location + ", ");
164 builder.append("kind=");
165 builder.append(kind + ", ");
166 builder.append("isPotential=");
167 builder.append(isPotential + ", ");
168 builder.append("path=");
169 builder.append(StringUtils.join(path, ", "));
170 builder.append("]");
171 return builder.toString();
172 }

Member Data Documentation

◆ EMPTY_ARRAY

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

Definition at line 34 of file SearchResult.java.

◆ EMPTY_LIST

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

Definition at line 36 of file SearchResult.java.


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