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

Public Member Functions

 FoldingRegion (String kind, int offset, int length)
 
boolean equals (Object obj)
 
String getKind ()
 
int getLength ()
 
int getOffset ()
 
int hashCode ()
 
JsonObject toJson ()
 
String toString ()
 

Static Public Member Functions

static FoldingRegion fromJson (JsonObject jsonObject)
 
static List< FoldingRegionfromJsonArray (JsonArray jsonArray)
 

Static Public Attributes

static final FoldingRegion[] EMPTY_ARRAY = new FoldingRegion[0]
 
static final List< FoldingRegionEMPTY_LIST = Lists.newArrayList()
 

Detailed Description

A description of a region that can be folded.

@coverage dart.server.generated.types

Definition at line 32 of file FoldingRegion.java.

Constructor & Destructor Documentation

◆ FoldingRegion()

org.dartlang.analysis.server.protocol.FoldingRegion.FoldingRegion ( String  kind,
int  offset,
int  length 
)
inline

Constructor for FoldingRegion.

Definition at line 56 of file FoldingRegion.java.

56 {
57 this.kind = kind;
58 this.offset = offset;
59 this.length = length;
60 }

Member Function Documentation

◆ equals()

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

Definition at line 63 of file FoldingRegion.java.

63 {
64 if (obj instanceof FoldingRegion) {
65 FoldingRegion other = (FoldingRegion) obj;
66 return
67 ObjectUtilities.equals(other.kind, kind) &&
68 other.offset == offset &&
69 other.length == length;
70 }
71 return false;
72 }
FoldingRegion(String kind, int offset, int length)

◆ fromJson()

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

Definition at line 74 of file FoldingRegion.java.

74 {
75 String kind = jsonObject.get("kind").getAsString();
76 int offset = jsonObject.get("offset").getAsInt();
77 int length = jsonObject.get("length").getAsInt();
78 return new FoldingRegion(kind, offset, length);
79 }

◆ fromJsonArray()

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

Definition at line 81 of file FoldingRegion.java.

81 {
82 if (jsonArray == null) {
83 return EMPTY_LIST;
84 }
85 ArrayList<FoldingRegion> list = new ArrayList<FoldingRegion>(jsonArray.size());
86 Iterator<JsonElement> iterator = jsonArray.iterator();
87 while (iterator.hasNext()) {
88 list.add(fromJson(iterator.next().getAsJsonObject()));
89 }
90 return list;
91 }
static final List< FoldingRegion > EMPTY_LIST
static FoldingRegion fromJson(JsonObject jsonObject)

◆ getKind()

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

The kind of the region.

Definition at line 96 of file FoldingRegion.java.

96 {
97 return kind;
98 }

◆ getLength()

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

The length of the region to be folded.

Definition at line 103 of file FoldingRegion.java.

103 {
104 return length;
105 }

◆ getOffset()

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

The offset of the region to be folded.

Definition at line 110 of file FoldingRegion.java.

110 {
111 return offset;
112 }

◆ hashCode()

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

Definition at line 115 of file FoldingRegion.java.

115 {
116 HashCodeBuilder builder = new HashCodeBuilder();
117 builder.append(kind);
118 builder.append(offset);
119 builder.append(length);
120 return builder.toHashCode();
121 }

◆ toJson()

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

Definition at line 123 of file FoldingRegion.java.

123 {
124 JsonObject jsonObject = new JsonObject();
125 jsonObject.addProperty("kind", kind);
126 jsonObject.addProperty("offset", offset);
127 jsonObject.addProperty("length", length);
128 return jsonObject;
129 }

◆ toString()

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

Definition at line 132 of file FoldingRegion.java.

132 {
133 StringBuilder builder = new StringBuilder();
134 builder.append("[");
135 builder.append("kind=");
136 builder.append(kind + ", ");
137 builder.append("offset=");
138 builder.append(offset + ", ");
139 builder.append("length=");
140 builder.append(length);
141 builder.append("]");
142 return builder.toString();
143 }

Member Data Documentation

◆ EMPTY_ARRAY

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

Definition at line 34 of file FoldingRegion.java.

◆ EMPTY_LIST

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

Definition at line 36 of file FoldingRegion.java.


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