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

Public Member Functions

 ClosingLabel (int offset, int length, String label)
 
boolean equals (Object obj)
 
String getLabel ()
 
int getLength ()
 
int getOffset ()
 
int hashCode ()
 
JsonObject toJson ()
 
String toString ()
 

Static Public Member Functions

static ClosingLabel fromJson (JsonObject jsonObject)
 
static List< ClosingLabelfromJsonArray (JsonArray jsonArray)
 

Static Public Attributes

static final ClosingLabel[] EMPTY_ARRAY = new ClosingLabel[0]
 
static final List< ClosingLabelEMPTY_LIST = Lists.newArrayList()
 

Detailed Description

A label that is associated with a range of code that may be useful to render at the end of the range to aid code readability. For example, a constructor call that spans multiple lines may result in a closing label to allow the constructor type/name to be rendered alongside the closing parenthesis.

@coverage dart.server.generated.types

Definition at line 35 of file ClosingLabel.java.

Constructor & Destructor Documentation

◆ ClosingLabel()

org.dartlang.analysis.server.protocol.ClosingLabel.ClosingLabel ( int  offset,
int  length,
String  label 
)
inline

Constructor for ClosingLabel.

Definition at line 59 of file ClosingLabel.java.

59 {
60 this.offset = offset;
61 this.length = length;
62 this.label = label;
63 }

Member Function Documentation

◆ equals()

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

Definition at line 66 of file ClosingLabel.java.

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

◆ fromJson()

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

Definition at line 77 of file ClosingLabel.java.

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

◆ fromJsonArray()

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

Definition at line 84 of file ClosingLabel.java.

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

◆ getLabel()

String org.dartlang.analysis.server.protocol.ClosingLabel.getLabel ( )
inline

The label associated with this range that should be displayed to the user.

Definition at line 99 of file ClosingLabel.java.

99 {
100 return label;
101 }

◆ getLength()

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

The length of the whole construct to be labelled.

Definition at line 106 of file ClosingLabel.java.

106 {
107 return length;
108 }

◆ getOffset()

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

The offset of the construct being labelled.

Definition at line 113 of file ClosingLabel.java.

113 {
114 return offset;
115 }

◆ hashCode()

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

Definition at line 118 of file ClosingLabel.java.

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

◆ toJson()

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

Definition at line 126 of file ClosingLabel.java.

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

◆ toString()

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

Definition at line 135 of file ClosingLabel.java.

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

Member Data Documentation

◆ EMPTY_ARRAY

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

Definition at line 37 of file ClosingLabel.java.

◆ EMPTY_LIST

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

Definition at line 39 of file ClosingLabel.java.


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