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

Public Member Functions

 HighlightRegion (String type, int offset, int length)
 
boolean containsInclusive (int x)
 
boolean equals (Object obj)
 
int getLength ()
 
int getOffset ()
 
String getType ()
 
int hashCode ()
 
JsonObject toJson ()
 
String toString ()
 

Static Public Member Functions

static HighlightRegion fromJson (JsonObject jsonObject)
 
static List< HighlightRegionfromJsonArray (JsonArray jsonArray)
 

Static Public Attributes

static final HighlightRegion[] EMPTY_ARRAY = new HighlightRegion[0]
 
static final List< HighlightRegionEMPTY_LIST = Lists.newArrayList()
 

Detailed Description

A description of a region that could have special highlighting associated with it.

@coverage dart.server.generated.types

Definition at line 32 of file HighlightRegion.java.

Constructor & Destructor Documentation

◆ HighlightRegion()

org.dartlang.analysis.server.protocol.HighlightRegion.HighlightRegion ( String  type,
int  offset,
int  length 
)
inline

Constructor for HighlightRegion.

Definition at line 56 of file HighlightRegion.java.

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

Member Function Documentation

◆ containsInclusive()

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

Definition at line 62 of file HighlightRegion.java.

62 {
63 return offset <= x && x <= offset + length;
64 }
double x

◆ equals()

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

Definition at line 67 of file HighlightRegion.java.

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

◆ fromJson()

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

Definition at line 78 of file HighlightRegion.java.

78 {
79 String type = jsonObject.get("type").getAsString();
80 int offset = jsonObject.get("offset").getAsInt();
81 int length = jsonObject.get("length").getAsInt();
82 return new HighlightRegion(type, offset, length);
83 }

◆ fromJsonArray()

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

Definition at line 85 of file HighlightRegion.java.

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

◆ getLength()

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

The length of the region to be highlighted.

Definition at line 100 of file HighlightRegion.java.

100 {
101 return length;
102 }

◆ getOffset()

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

The offset of the region to be highlighted.

Definition at line 107 of file HighlightRegion.java.

107 {
108 return offset;
109 }

◆ getType()

String org.dartlang.analysis.server.protocol.HighlightRegion.getType ( )
inline

The type of highlight associated with the region.

Definition at line 114 of file HighlightRegion.java.

114 {
115 return type;
116 }

◆ hashCode()

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

Definition at line 119 of file HighlightRegion.java.

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

◆ toJson()

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

Definition at line 127 of file HighlightRegion.java.

127 {
128 JsonObject jsonObject = new JsonObject();
129 jsonObject.addProperty("type", type);
130 jsonObject.addProperty("offset", offset);
131 jsonObject.addProperty("length", length);
132 return jsonObject;
133 }

◆ toString()

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

Definition at line 136 of file HighlightRegion.java.

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

Member Data Documentation

◆ EMPTY_ARRAY

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

Definition at line 34 of file HighlightRegion.java.

◆ EMPTY_LIST

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

Definition at line 36 of file HighlightRegion.java.


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