paul@72 | 1 | #!/usr/bin/env python |
paul@72 | 2 | |
paul@72 | 3 | class Character(object): |
paul@72 | 4 | def __init__(self, value): |
paul@72 | 5 | raise NotImplementedError, "__init__" |
paul@72 | 6 | def charValue(self): |
paul@72 | 7 | raise NotImplementedError, "charValue" |
paul@72 | 8 | def hashCode(self): |
paul@72 | 9 | raise NotImplementedError, "hashCode" |
paul@72 | 10 | def equals(self, anObject): |
paul@72 | 11 | raise NotImplementedError, "equals" |
paul@72 | 12 | def toString(self): |
paul@72 | 13 | raise NotImplementedError, "toString" |
paul@72 | 14 | def isLowerCase(self, ch): |
paul@72 | 15 | raise NotImplementedError, "isLowerCase" |
paul@72 | 16 | isLowerCase = staticmethod(isLowerCase) |
paul@72 | 17 | def isUpperCase(self, ch): |
paul@72 | 18 | raise NotImplementedError, "isUpperCase" |
paul@72 | 19 | isUpperCase = staticmethod(isUpperCase) |
paul@72 | 20 | def isTitleCase(self, ch): |
paul@72 | 21 | raise NotImplementedError, "isTitleCase" |
paul@72 | 22 | isTitleCase = staticmethod(isTitleCase) |
paul@72 | 23 | def isDigit(self, ch): |
paul@72 | 24 | raise NotImplementedError, "isDigit" |
paul@72 | 25 | isDigit = staticmethod(isDigit) |
paul@72 | 26 | def isDefined(self, ch): |
paul@72 | 27 | raise NotImplementedError, "isDefined" |
paul@72 | 28 | isDefined = staticmethod(isDefined) |
paul@72 | 29 | def isLetter(self, ch): |
paul@72 | 30 | raise NotImplementedError, "isLetter" |
paul@72 | 31 | isLetter = staticmethod(isLetter) |
paul@72 | 32 | def isLetterOrDigit(self, ch): |
paul@72 | 33 | raise NotImplementedError, "isLetterOrDigit" |
paul@72 | 34 | isLetterOrDigit = staticmethod(isLetterOrDigit) |
paul@72 | 35 | def isJavaLetter(self, ch): |
paul@72 | 36 | raise NotImplementedError, "isJavaLetter" |
paul@72 | 37 | isJavaLetter = staticmethod(isJavaLetter) |
paul@72 | 38 | def isJavaLetterOrDigit(self, ch): |
paul@72 | 39 | raise NotImplementedError, "isJavaLetterOrDigit" |
paul@72 | 40 | isJavaLetterOrDigit = staticmethod(isJavaLetterOrDigit) |
paul@72 | 41 | def isJavaIdentifierStart(self, ch): |
paul@72 | 42 | raise NotImplementedError, "isJavaIdentifierStart" |
paul@72 | 43 | isJavaIdentifierStart = staticmethod(isJavaIdentifierStart) |
paul@72 | 44 | def isJavaIdentifierPart(self, ch): |
paul@72 | 45 | raise NotImplementedError, "isJavaIdentifierPart" |
paul@72 | 46 | isJavaIdentifierPart = staticmethod(isJavaIdentifierPart) |
paul@72 | 47 | def isUnicodeIdentifierStart(self, ch): |
paul@72 | 48 | raise NotImplementedError, "isUnicodeIdentifierStart" |
paul@72 | 49 | isUnicodeIdentifierStart = staticmethod(isUnicodeIdentifierStart) |
paul@72 | 50 | def isUnicodeIdentifierPart(self, ch): |
paul@72 | 51 | raise NotImplementedError, "isUnicodeIdentifierPart" |
paul@72 | 52 | isUnicodeIdentifierPart = staticmethod(isUnicodeIdentifierPart) |
paul@72 | 53 | def isIdentifierIgnorable(self, ch): |
paul@72 | 54 | raise NotImplementedError, "isIdentifierIgnorable" |
paul@72 | 55 | isIdentifierIgnorable = staticmethod(isIdentifierIgnorable) |
paul@72 | 56 | def toLowerCase(self, ch): |
paul@72 | 57 | raise NotImplementedError, "toLowerCase" |
paul@72 | 58 | toLowerCase = staticmethod(toLowerCase) |
paul@72 | 59 | def toUpperCase(self, ch): |
paul@72 | 60 | raise NotImplementedError, "toUpperCase" |
paul@72 | 61 | toUpperCase = staticmethod(toUpperCase) |
paul@72 | 62 | def toTitleCase(self, ch): |
paul@72 | 63 | raise NotImplementedError, "toTitleCase" |
paul@72 | 64 | toTitleCase = staticmethod(toTitleCase) |
paul@72 | 65 | def digit(self, ch, radix): |
paul@72 | 66 | raise NotImplementedError, "digit" |
paul@72 | 67 | digit = staticmethod(digit) |
paul@72 | 68 | def getNumericValue(self, ch): |
paul@72 | 69 | raise NotImplementedError, "getNumericValue" |
paul@72 | 70 | getNumericValue = staticmethod(getNumericValue) |
paul@72 | 71 | def isSpace(self, ch): |
paul@72 | 72 | raise NotImplementedError, "isSpace" |
paul@72 | 73 | isSpace = staticmethod(isSpace) |
paul@72 | 74 | def isSpaceChar(self, ch): |
paul@72 | 75 | raise NotImplementedError, "isSpaceChar" |
paul@72 | 76 | isSpaceChar = staticmethod(isSpaceChar) |
paul@72 | 77 | def isWhitespace(self, ch): |
paul@72 | 78 | raise NotImplementedError, "isWhitespace" |
paul@72 | 79 | isWhitespace = staticmethod(isWhitespace) |
paul@72 | 80 | def isISOControl(self, ch): |
paul@72 | 81 | raise NotImplementedError, "isISOControl" |
paul@72 | 82 | isISOControl = staticmethod(isISOControl) |
paul@72 | 83 | def getType(self, ch): |
paul@72 | 84 | raise NotImplementedError, "getType" |
paul@72 | 85 | getType = staticmethod(getType) |
paul@72 | 86 | def forDigit(self, ch, radix): |
paul@72 | 87 | raise NotImplementedError, "forDigit" |
paul@72 | 88 | forDigit = staticmethod(forDigit) |
paul@72 | 89 | def compareTo(self, *args): |
paul@72 | 90 | # compareTo(self, anotherCharacter) |
paul@72 | 91 | # compareTo(self, o) |
paul@72 | 92 | raise NotImplementedError, "compareTo" |
paul@72 | 93 | |
paul@72 | 94 | class String(object): |
paul@72 | 95 | def __init__(self, *args): |
paul@72 | 96 | # Python string initialisation: |
paul@72 | 97 | if len(args) == 1 and isinstance(args[0], str): |
paul@72 | 98 | self.value = unicode(args[0]) |
paul@72 | 99 | return |
paul@72 | 100 | elif len(args) == 1 and isinstance(args[0], unicode): |
paul@72 | 101 | self.value = args[0] |
paul@72 | 102 | return |
paul@72 | 103 | # __init__(self) |
paul@72 | 104 | elif len(args) == 0: |
paul@72 | 105 | self.value = u"" |
paul@72 | 106 | return |
paul@72 | 107 | # __init__(self, original) |
paul@72 | 108 | elif len(args) == 1 and isinstance(args[0], String): |
paul@72 | 109 | self.value = args[0].value |
paul@72 | 110 | return |
paul@72 | 111 | # __init__(self, value) |
paul@72 | 112 | # __init__(self, value, offset, count) |
paul@72 | 113 | # __init__(self, ascii, hibyte, offset, count) |
paul@72 | 114 | # __init__(self, ascii, hibyte) |
paul@72 | 115 | # __init__(self, bytes, offset, length, enc) |
paul@72 | 116 | # __init__(self, bytes, enc) |
paul@72 | 117 | # __init__(self, bytes, offset, length) |
paul@72 | 118 | # __init__(self, bytes) |
paul@72 | 119 | elif len(args) >= 1 and isinstance(args[0], list): |
paul@72 | 120 | raise NotImplementedError, "__init__" |
paul@72 | 121 | # __init__(self, buffer) |
paul@72 | 122 | raise NotImplementedError, "__init__" |
paul@72 | 123 | def length(self): |
paul@72 | 124 | return len(self.value) |
paul@72 | 125 | def charAt(self, index): |
paul@72 | 126 | return self.value[index] |
paul@72 | 127 | def getChars(self, srcBegin, srcEnd, dst, dstBegin): |
paul@72 | 128 | raise NotImplementedError, "getChars" |
paul@72 | 129 | def getBytes(self, *args): |
paul@72 | 130 | # void getBytes(self, srcBegin, srcEnd, dst, dstBegin) |
paul@72 | 131 | # byte[] getBytes(self, enc) |
paul@72 | 132 | # byte[] getBytes(self) |
paul@72 | 133 | raise NotImplementedError, "getBytes" |
paul@72 | 134 | def equals(self, anObject): |
paul@72 | 135 | raise NotImplementedError, "equals" |
paul@72 | 136 | def compareTo(self, obj): |
paul@72 | 137 | raise NotImplementedError, "compareTo" |
paul@72 | 138 | # NOTE: Comparator defined using private classes. |
paul@72 | 139 | def compareToIgnoreCase(self, str): |
paul@72 | 140 | raise NotImplementedError, "compareToIgnoreCase" |
paul@72 | 141 | def regionMatches(self, *args): |
paul@72 | 142 | # regionMatches(self, toffset, other, ooffset, len) |
paul@72 | 143 | # regionMatches(self, ignoreCase, toffset, other, ooffset, len) |
paul@72 | 144 | raise NotImplementedError, "regionMatches" |
paul@72 | 145 | def startsWith(self, *args): |
paul@72 | 146 | # startsWith(self, prefix, toffset) |
paul@72 | 147 | # startsWith(self, prefix) |
paul@72 | 148 | raise NotImplementedError, "startsWith" |
paul@72 | 149 | def endsWith(self, suffix): |
paul@72 | 150 | raise NotImplementedError, "endsWith" |
paul@72 | 151 | def hashCode(self): |
paul@72 | 152 | raise NotImplementedError, "hashCode" |
paul@72 | 153 | def indexOf(self, *args): |
paul@72 | 154 | # indexOf(self, ch) |
paul@72 | 155 | # indexOf(self, ch, fromIndex) |
paul@72 | 156 | # indexOf(self, str) |
paul@72 | 157 | # indexOf(self, str, fromIndex) |
paul@72 | 158 | raise NotImplementedError, "indexOf" |
paul@72 | 159 | def lastIndexOf(self, *args): |
paul@72 | 160 | # lastIndexOf(self, ch) |
paul@72 | 161 | # lastIndexOf(self, ch, fromIndex) |
paul@72 | 162 | # lastIndexOf(self, str) |
paul@72 | 163 | # lastIndexOf(self, str, fromIndex) |
paul@72 | 164 | raise NotImplementedError, "lastIndexOf" |
paul@72 | 165 | def substring(self, *args): |
paul@72 | 166 | # substring(self, beginIndex) |
paul@72 | 167 | # substring(self, beginIndex, endIndex) |
paul@72 | 168 | raise NotImplementedError, "substring" |
paul@72 | 169 | def concat(self, str): |
paul@72 | 170 | raise NotImplementedError, "concat" |
paul@72 | 171 | def replace(self, oldChar, newChar): |
paul@72 | 172 | raise NotImplementedError, "replace" |
paul@72 | 173 | def toLowerCase(self, *args): |
paul@72 | 174 | # toLowerCase(self, locale) |
paul@72 | 175 | # toLowerCase(self) |
paul@72 | 176 | raise NotImplementedError, "toLowerCase" |
paul@72 | 177 | def toUpperCase(self, *args): |
paul@72 | 178 | # toUpperCase(self, locale) |
paul@72 | 179 | # toUpperCase(self) |
paul@72 | 180 | raise NotImplementedError, "toUpperCase" |
paul@72 | 181 | def trim(self): |
paul@72 | 182 | raise NotImplementedError, "trim" |
paul@72 | 183 | def toString(self): |
paul@72 | 184 | return self |
paul@72 | 185 | def toCharArray(self): |
paul@72 | 186 | raise NotImplementedError, "toCharArray" |
paul@72 | 187 | def valueOf(self, *args): |
paul@72 | 188 | # valueOf(self, obj) |
paul@72 | 189 | # valueOf(self, data) |
paul@72 | 190 | # valueOf(self, data, offset, count) |
paul@72 | 191 | # valueOf(self, b) |
paul@72 | 192 | # valueOf(self, c) |
paul@72 | 193 | # valueOf(self, l) |
paul@72 | 194 | # valueOf(self, f) |
paul@72 | 195 | # valueOf(self, d) |
paul@72 | 196 | raise NotImplementedError, "valueOf" |
paul@72 | 197 | valueOf = staticmethod(valueOf) |
paul@72 | 198 | def copyValueOf(self, *args): |
paul@72 | 199 | # copyValueOf(self, data, offset, count) |
paul@72 | 200 | # copyValueOf(self, data) |
paul@72 | 201 | raise NotImplementedError, "copyValueOf" |
paul@72 | 202 | copyValueOf = staticmethod(copyValueOf) |
paul@72 | 203 | def intern(self): |
paul@72 | 204 | raise NotImplementedError, "intern" |
paul@72 | 205 | |
paul@72 | 206 | # vim: tabstop=4 expandtab shiftwidth=4 |