| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
package net.sf.saxon.regex; |
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
public final class EmptyString extends UnicodeString { |
| 15 |
|
| 16 |
public final static EmptyString THE_INSTANCE = new EmptyString(); |
| 17 |
|
| 18 |
private EmptyString() {}; |
| 19 |
|
| 20 |
|
| 21 |
public EmptyString uSubstring(int beginIndex, int endIndex) { |
| 22 |
if (beginIndex == 0 && endIndex == 0) { |
| 23 |
return this; |
| 24 |
} else { |
| 25 |
throw new IndexOutOfBoundsException(); |
| 26 |
} |
| 27 |
} |
| 28 |
|
| 29 |
public int uCharAt(int pos) { |
| 30 |
throw new IndexOutOfBoundsException(); |
| 31 |
} |
| 32 |
|
| 33 |
public int uIndexOf(int search, int pos) { |
| 34 |
return -1; |
| 35 |
} |
| 36 |
|
| 37 |
public int uLength() { |
| 38 |
return 0; |
| 39 |
} |
| 40 |
|
| 41 |
public boolean isEnd(int pos) { |
| 42 |
return pos == 0; |
| 43 |
} |
| 44 |
|
| 45 |
public String toString() { |
| 46 |
return ""; |
| 47 |
} |
| 48 |
|
| 49 |
public int length() { |
| 50 |
return 0; |
| 51 |
} |
| 52 |
|
| 53 |
public char charAt(int index) { |
| 54 |
throw new IndexOutOfBoundsException(); |
| 55 |
} |
| 56 |
|
| 57 |
public CharSequence subSequence(int start, int end) { |
| 58 |
if (start == 0 && end == 0) { |
| 59 |
return ""; |
| 60 |
} else { |
| 61 |
throw new IndexOutOfBoundsException(); |
| 62 |
} |
| 63 |
} |
| 64 |
|
| 65 |
} |