Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(62)

Unified Diff: editor/tools/plugins/com.google.dart.engine.services/src/com/google/dart/engine/services/change/Edit.java

Issue 250823006: Translate parts of engine.services project. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Move to pkg/analysis_services/ Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: editor/tools/plugins/com.google.dart.engine.services/src/com/google/dart/engine/services/change/Edit.java
diff --git a/editor/tools/plugins/com.google.dart.engine.services/src/com/google/dart/engine/services/change/Edit.java b/editor/tools/plugins/com.google.dart.engine.services/src/com/google/dart/engine/services/change/Edit.java
index 53447be2cde9ed009291c18dd8389bb4bdc0d33f..95392bbd76cade16ceee57df9182f536a75040b7 100644
--- a/editor/tools/plugins/com.google.dart.engine.services/src/com/google/dart/engine/services/change/Edit.java
+++ b/editor/tools/plugins/com.google.dart.engine.services/src/com/google/dart/engine/services/change/Edit.java
@@ -15,6 +15,7 @@ package com.google.dart.engine.services.change;
import com.google.dart.engine.source.Source;
import com.google.dart.engine.utilities.source.SourceRange;
+import com.google.dart.engine.utilities.translation.DartName;
/**
* Describes a text edit. Edits are executed by applying them to a {@link Source}.
@@ -23,17 +24,17 @@ public class Edit {
/**
* The offset at which to apply the edit.
*/
- public final int offset;
+ private final int offset;
/**
* The length of the text interval to replace.
*/
- public final int length;
+ private final int length;
/**
* The replacement text.
*/
- public final String replacement;
+ private final String replacement;
/**
* Create an edit.
@@ -54,10 +55,30 @@ public class Edit {
* @param range the {@link SourceRange} to replace
* @param replacement the replacement text
*/
+ @DartName("range")
public Edit(SourceRange range, String replacement) {
- this.offset = range.getOffset();
- this.length = range.getLength();
- this.replacement = replacement;
+ this(range.getOffset(), range.getLength(), replacement);
+ }
+
+ /**
+ * Returns the length of the text interval to replace.
+ */
+ public int getLength() {
+ return length;
+ }
+
+ /**
+ * Returns the offset at which to apply the edit.
+ */
+ public int getOffset() {
+ return offset;
+ }
+
+ /**
+ * Returns the replacement text.
+ */
+ public String getReplacement() {
+ return replacement;
}
@Override

Powered by Google App Engine
This is Rietveld 408576698