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

Public Member Functions

 Outline (Outline parent, Element element, int offset, int length, int codeOffset, int codeLength)
 
boolean containsInclusive (int x)
 
boolean equals (Object obj)
 
Outline getParent ()
 
List< OutlinegetChildren ()
 
int getCodeLength ()
 
int getCodeOffset ()
 
Element getElement ()
 
int getLength ()
 
int getOffset ()
 
int hashCode ()
 
void setChildren (List< Outline > children)
 
void setCodeLength (int codeLength)
 
void setCodeOffset (int codeOffset)
 
void setElement (Element element)
 
void setLength (int length)
 
void setOffset (int offset)
 
String toString ()
 

Static Public Member Functions

static Outline fromJson (Outline parent, JsonObject outlineObject)
 

Static Public Attributes

static final Outline[] EMPTY_ARRAY = new Outline[0]
 
static final List< OutlineEMPTY_LIST = Lists.newArrayList()
 

Detailed Description

An node in the outline structure of a file.

@coverage dart.server.generated.types

Definition at line 32 of file Outline.java.

Constructor & Destructor Documentation

◆ Outline()

org.dartlang.analysis.server.protocol.Outline.Outline ( Outline  parent,
Element  element,
int  offset,
int  length,
int  codeOffset,
int  codeLength 
)
inline

Constructor for Outline.

Definition at line 73 of file Outline.java.

73 {
74 this.parent = parent;
75 this.element = element;
76 this.offset = offset;
77 this.length = length;
78 this.codeOffset = codeOffset;
79 this.codeLength = codeLength;
80 }

Member Function Documentation

◆ containsInclusive()

boolean org.dartlang.analysis.server.protocol.Outline.containsInclusive ( int  x)
inline

Definition at line 82 of file Outline.java.

82 {
83 return offset <= x && x <= offset + length;
84 }
double x

◆ equals()

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

Definition at line 87 of file Outline.java.

87 {
88 if (obj instanceof Outline) {
89 Outline other = (Outline) obj;
90 return
91 ObjectUtilities.equals(other.element, element) &&
92 other.offset == offset &&
93 other.length == length &&
94 other.codeOffset == codeOffset &&
95 other.codeLength == codeLength &&
96 ObjectUtilities.equals(other.children, children);
97 }
98 return false;
99 }
Outline(Outline parent, Element element, int offset, int length, int codeOffset, int codeLength)
Definition: Outline.java:73

◆ fromJson()

static Outline org.dartlang.analysis.server.protocol.Outline.fromJson ( Outline  parent,
JsonObject  outlineObject 
)
inlinestatic

Definition at line 101 of file Outline.java.

101 {
102 JsonObject elementObject = outlineObject.get("element").getAsJsonObject();
103 Element element = Element.fromJson(elementObject);
104 int offset = outlineObject.get("offset").getAsInt();
105 int length = outlineObject.get("length").getAsInt();
106 int codeOffset = outlineObject.get("codeOffset").getAsInt();
107 int codeLength = outlineObject.get("codeLength").getAsInt();
108
109 // create outline object
110 Outline outline = new Outline(parent, element, offset, length, codeOffset, codeLength);
111
112 // compute children recursively
113 List<Outline> childrenList = Lists.newArrayList();
114 JsonElement childrenJsonArray = outlineObject.get("children");
115 if (childrenJsonArray instanceof JsonArray) {
116 Iterator<JsonElement> childrenElementIterator = ((JsonArray) childrenJsonArray).iterator();
117 while (childrenElementIterator.hasNext()) {
118 JsonObject childObject = childrenElementIterator.next().getAsJsonObject();
119 childrenList.add(fromJson(outline, childObject));
120 }
121 }
122 outline.setChildren(childrenList);
123 return outline;
124 }
void add(sk_sp< SkIDChangeListener > listener) SK_EXCLUDES(fMutex)
static Outline fromJson(Outline parent, JsonObject outlineObject)
Definition: Outline.java:101
Definition: dart.idl:42

◆ getChildren()

List< Outline > org.dartlang.analysis.server.protocol.Outline.getChildren ( )
inline

The children of the node. The field will be omitted if the node has no children. Children are sorted by offset.

Definition at line 134 of file Outline.java.

134 {
135 return children;
136 }

◆ getCodeLength()

int org.dartlang.analysis.server.protocol.Outline.getCodeLength ( )
inline

The length of the element code.

Definition at line 141 of file Outline.java.

141 {
142 return codeLength;
143 }

◆ getCodeOffset()

int org.dartlang.analysis.server.protocol.Outline.getCodeOffset ( )
inline

The offset of the first character of the element code, which is neither documentation, nor annotation.

Definition at line 149 of file Outline.java.

149 {
150 return codeOffset;
151 }

◆ getElement()

Element org.dartlang.analysis.server.protocol.Outline.getElement ( )
inline

A description of the element represented by this node.

Definition at line 156 of file Outline.java.

156 {
157 return element;
158 }

◆ getLength()

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

The length of the element.

Definition at line 163 of file Outline.java.

163 {
164 return length;
165 }

◆ getOffset()

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

The offset of the first character of the element. This is different than the offset in the Element, which is the offset of the name of the element. It can be used, for example, to map locations in the file back to an outline.

Definition at line 172 of file Outline.java.

172 {
173 return offset;
174 }

◆ getParent()

Outline org.dartlang.analysis.server.protocol.Outline.getParent ( )
inline

Definition at line 126 of file Outline.java.

126 {
127 return parent;
128 }

◆ hashCode()

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

Definition at line 177 of file Outline.java.

177 {
178 HashCodeBuilder builder = new HashCodeBuilder();
179 builder.append(element);
180 builder.append(offset);
181 builder.append(length);
182 builder.append(codeOffset);
183 builder.append(codeLength);
184 builder.append(children);
185 return builder.toHashCode();
186 }

◆ setChildren()

void org.dartlang.analysis.server.protocol.Outline.setChildren ( List< Outline children)
inline

The children of the node. The field will be omitted if the node has no children. Children are sorted by offset.

Definition at line 192 of file Outline.java.

192 {
193 this.children = children;
194 }

◆ setCodeLength()

void org.dartlang.analysis.server.protocol.Outline.setCodeLength ( int  codeLength)
inline

The length of the element code.

Definition at line 199 of file Outline.java.

199 {
200 this.codeLength = codeLength;
201 }

◆ setCodeOffset()

void org.dartlang.analysis.server.protocol.Outline.setCodeOffset ( int  codeOffset)
inline

The offset of the first character of the element code, which is neither documentation, nor annotation.

Definition at line 207 of file Outline.java.

207 {
208 this.codeOffset = codeOffset;
209 }

◆ setElement()

void org.dartlang.analysis.server.protocol.Outline.setElement ( Element  element)
inline

A description of the element represented by this node.

Definition at line 214 of file Outline.java.

214 {
215 this.element = element;
216 }

◆ setLength()

void org.dartlang.analysis.server.protocol.Outline.setLength ( int  length)
inline

The length of the element.

Definition at line 221 of file Outline.java.

221 {
222 this.length = length;
223 }

◆ setOffset()

void org.dartlang.analysis.server.protocol.Outline.setOffset ( int  offset)
inline

The offset of the first character of the element. This is different than the offset in the Element, which is the offset of the name of the element. It can be used, for example, to map locations in the file back to an outline.

Definition at line 230 of file Outline.java.

230 {
231 this.offset = offset;
232 }

◆ toString()

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

Definition at line 235 of file Outline.java.

235 {
236 StringBuilder builder = new StringBuilder();
237 builder.append("[");
238 builder.append("element=");
239 builder.append(element + ", ");
240 builder.append("offset=");
241 builder.append(offset + ", ");
242 builder.append("length=");
243 builder.append(length + ", ");
244 builder.append("codeOffset=");
245 builder.append(codeOffset + ", ");
246 builder.append("codeLength=");
247 builder.append(codeLength + ", ");
248 builder.append("children=");
249 builder.append(StringUtils.join(children, ", "));
250 builder.append("]");
251 return builder.toString();
252 }

Member Data Documentation

◆ EMPTY_ARRAY

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

Definition at line 34 of file Outline.java.

◆ EMPTY_LIST

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

Definition at line 36 of file Outline.java.


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