summaryrefslogtreecommitdiff
path: root/sources/scalac/util
diff options
context:
space:
mode:
authorpaltherr <paltherr@epfl.ch>2004-03-13 15:56:39 +0000
committerpaltherr <paltherr@epfl.ch>2004-03-13 15:56:39 +0000
commit848d9a68a9e45a78ad991e8c3210d01b9486c18d (patch)
tree573f40f4dbf6c52dbdd44c7e51ded83524066872 /sources/scalac/util
parent354a08de0ddf313f4e6293a2a439c7f5ca51144b (diff)
downloadscala-848d9a68a9e45a78ad991e8c3210d01b9486c18d.tar.gz
scala-848d9a68a9e45a78ad991e8c3210d01b9486c18d.tar.bz2
scala-848d9a68a9e45a78ad991e8c3210d01b9486c18d.zip
- In class Name renamed sub, pos, lastPos into ...
- In class Name renamed sub, pos, lastPos into charAt, indexOf, - lastIndexOf In those methdos, replaced byte by char
Diffstat (limited to 'sources/scalac/util')
-rw-r--r--sources/scalac/util/Name.java28
1 files changed, 14 insertions, 14 deletions
diff --git a/sources/scalac/util/Name.java b/sources/scalac/util/Name.java
index 8585139c78..6db5ced772 100644
--- a/sources/scalac/util/Name.java
+++ b/sources/scalac/util/Name.java
@@ -201,30 +201,30 @@ public final class Name {
return len;
}
-/** returns i'th byte of this name
+/** returns i'th char of this name
*/
- public byte sub(int i) {
- return names[index + i];
+ public char charAt(int i) {
+ return (char)names[index + i];
}
-/** returns first occurrence of byte b in this name, len if not found
+/** returns first occurrence of char c in this name, -1 if not found
*/
- public int pos(byte b) {
- return pos(b, 0);
+ public int indexOf(char c) {
+ return indexOf(c, 0);
}
-/** returns first occurrence of byte b in this name from `start', len if not found
+/** returns first occurrence of char c in this name from `start', -1 if not found
*/
- public int pos(byte b, int start) {
- int i = start;
- while (i < len && names[index + i] != b)
- i++;
- return i;
+ public int indexOf(char c, int start) {
+ byte b = (byte)c;
+ for (int i = start; i < len; i++) if (names[index + i] == b) return i;
+ return -1;
}
-/** returns last occurrence of byte b in this name, -1 if not found.
+/** returns last occurrence of char c in this name, -1 if not found.
*/
- public int lastPos(byte b) {
+ public int lastIndexOf(byte c) {
+ byte b = (byte)c;
int i = len - 1;
while (i >= 0 && names[index + i] != b)
i--;