Method from java.text.RuleBasedBreakIterator$SafeCharIterator Detail: |
public Object clone() {
SafeCharIterator copy = null;
try {
copy = (SafeCharIterator) super.clone();
}
catch(CloneNotSupportedException e) {
throw new Error("Clone not supported: " + e);
}
CharacterIterator copyOfBase = (CharacterIterator) base.clone();
copy.base = copyOfBase;
return copy;
}
|
public char current() {
if (currentIndex < rangeStart || currentIndex >= rangeLimit) {
return DONE;
}
else {
return base.setIndex(currentIndex);
}
}
|
public char first() {
return setIndex(rangeStart);
}
|
public int getBeginIndex() {
return rangeStart;
}
|
public int getEndIndex() {
return rangeLimit;
}
|
public int getIndex() {
return currentIndex;
}
|
public char last() {
return setIndex(rangeLimit - 1);
}
|
public char next() {
currentIndex++;
if (currentIndex >= rangeLimit) {
currentIndex = rangeLimit;
return DONE;
}
else {
return base.setIndex(currentIndex);
}
}
|
public char previous() {
currentIndex--;
if (currentIndex < rangeStart) {
currentIndex = rangeStart;
return DONE;
}
else {
return base.setIndex(currentIndex);
}
}
|
public char setIndex(int i) {
if (i < rangeStart || i > rangeLimit) {
throw new IllegalArgumentException("Invalid position");
}
currentIndex = i;
return current();
}
|