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

Unified Diff: pkg/analyzer/lib/src/generated/java_core.dart

Issue 267293006: New analyzer snapshot. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 7 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
« no previous file with comments | « pkg/analyzer/lib/src/generated/index.dart ('k') | pkg/analyzer/lib/src/generated/java_engine.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/generated/java_core.dart
diff --git a/pkg/analyzer/lib/src/generated/java_core.dart b/pkg/analyzer/lib/src/generated/java_core.dart
index b613897ec4da31e085236806eb5225e575f4b26e..2c992169b8f2aef58de3e2f64ade8fcfac90f026 100644
--- a/pkg/analyzer/lib/src/generated/java_core.dart
+++ b/pkg/analyzer/lib/src/generated/java_core.dart
@@ -229,8 +229,55 @@ class PrintStringWriter extends PrintWriter {
}
class StringUtils {
- static List<String> split(String s, [String pattern = '']) => s.split(pattern);
- static String replace(String s, String from, String to) => s.replaceAll(from, to);
+ static String capitalize(String str) {
+ if (isEmpty(str)) {
+ return str;
+ }
+ return str.substring(0, 1).toUpperCase() + str.substring(1);
+ }
+
+ static bool equals(String cs1, String cs2) {
+ if (cs1 == cs2) {
+ return true;
+ }
+ if (cs1 == null || cs2 == null) {
+ return false;
+ }
+ return cs1 == cs2;
+ }
+
+ static bool isEmpty(String str) {
+ return str == null || str.isEmpty;
+ }
+
+ static String join(Iterable iter, [String separator = ' ', int start = 0, int
+ end = -1]) {
+ if (start != 0) {
+ iter = iter.skip(start);
+ }
+ if (end != -1) {
+ iter = iter.take(end - start);
+ }
+ return iter.join(separator);
+ }
+
+ static String remove(String str, String remove) {
+ if (isEmpty(str) || isEmpty(remove)) {
+ return str;
+ }
+ return str.replaceAll(remove, '');
+ }
+
+ static String removeStart(String str, String remove) {
+ if (isEmpty(str) || isEmpty(remove)) {
+ return str;
+ }
+ if (str.startsWith(remove)) {
+ return str.substring(remove.length);
+ }
+ return str;
+ }
+
static String repeat(String s, int n) {
StringBuffer sb = new StringBuffer();
for (int i = 0; i < n; i++) {
@@ -238,8 +285,14 @@ class StringUtils {
}
return sb.toString();
}
- static String join(Iterable iter, [String separator = " "]) {
- return iter.join(separator);
+
+ static List<String> split(String s, [String pattern = '']) {
+ return s.split(pattern);
+ }
+
+ static List<String> splitByWholeSeparatorPreserveAllTokens(String s, String
+ pattern) {
+ return s.split(pattern);
}
}
« no previous file with comments | « pkg/analyzer/lib/src/generated/index.dart ('k') | pkg/analyzer/lib/src/generated/java_engine.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698