StringUCharacterIterator.java
2.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
/*
* Decompiled with CFR 0_118.
*/
package com.adobe.agl.impl;
import com.adobe.agl.text.UCharacterIterator;
public final class StringUCharacterIterator
extends UCharacterIterator {
private String m_text_;
private int m_currentIndex_;
public StringUCharacterIterator(String str) {
if (str == null) {
throw new IllegalArgumentException();
}
this.m_text_ = str;
this.m_currentIndex_ = 0;
}
public StringUCharacterIterator() {
this.m_text_ = "";
this.m_currentIndex_ = 0;
}
public Object clone() {
try {
return super.clone();
}
catch (CloneNotSupportedException e) {
return null;
}
}
public int current() {
if (this.m_currentIndex_ < this.m_text_.length()) {
return this.m_text_.charAt(this.m_currentIndex_);
}
return -1;
}
public int getLength() {
return this.m_text_.length();
}
public int getIndex() {
return this.m_currentIndex_;
}
public int next() {
if (this.m_currentIndex_ < this.m_text_.length()) {
return this.m_text_.charAt(this.m_currentIndex_++);
}
return -1;
}
public int previous() {
if (this.m_currentIndex_ > 0) {
return this.m_text_.charAt(--this.m_currentIndex_);
}
return -1;
}
public void setIndex(int currentIndex) throws IndexOutOfBoundsException {
if (currentIndex < 0 || currentIndex > this.m_text_.length()) {
throw new IndexOutOfBoundsException();
}
this.m_currentIndex_ = currentIndex;
}
public int getText(char[] fillIn, int offset) {
int length = this.m_text_.length();
if (offset < 0 || offset + length > fillIn.length) {
throw new IndexOutOfBoundsException(Integer.toString(length));
}
this.m_text_.getChars(0, length, fillIn, offset);
return length;
}
public String getText() {
return this.m_text_;
}
public void setText(String text) {
if (text == null) {
throw new NullPointerException();
}
this.m_text_ = text;
this.m_currentIndex_ = 0;
}
}