0001: package org.python.core;
0002:
0003: import org.python.modules._codecs;
0004:
0005: /**
0006: * a builtin python unicode string.
0007: */
0008:
0009: public class PyUnicode extends PyString {
0010: public static final Class exposed_base = PyBaseString.class;
0011:
0012: //~ BEGIN GENERATED REGION -- DO NOT EDIT SEE gexpose.py
0013: /* type info */
0014:
0015: public static final String exposed_name = "unicode";
0016:
0017: public static void typeSetup(PyObject dict, PyType.Newstyle marker) {
0018: class exposed___ne__ extends PyBuiltinMethodNarrow {
0019:
0020: exposed___ne__(PyObject self, PyBuiltinFunction.Info info) {
0021: super (self, info);
0022: }
0023:
0024: public PyBuiltinFunction bind(PyObject self) {
0025: return new exposed___ne__(self, info);
0026: }
0027:
0028: public PyObject __call__(PyObject arg0) {
0029: PyObject ret = ((PyUnicode) self).unicode___ne__(arg0);
0030: if (ret == null)
0031: return Py.NotImplemented;
0032: return ret;
0033: }
0034:
0035: }
0036: dict.__setitem__("__ne__", new PyMethodDescr("__ne__",
0037: PyUnicode.class, 1, 1, new exposed___ne__(null, null)));
0038: class exposed___eq__ extends PyBuiltinMethodNarrow {
0039:
0040: exposed___eq__(PyObject self, PyBuiltinFunction.Info info) {
0041: super (self, info);
0042: }
0043:
0044: public PyBuiltinFunction bind(PyObject self) {
0045: return new exposed___eq__(self, info);
0046: }
0047:
0048: public PyObject __call__(PyObject arg0) {
0049: PyObject ret = ((PyUnicode) self).unicode___eq__(arg0);
0050: if (ret == null)
0051: return Py.NotImplemented;
0052: return ret;
0053: }
0054:
0055: }
0056: dict.__setitem__("__eq__", new PyMethodDescr("__eq__",
0057: PyUnicode.class, 1, 1, new exposed___eq__(null, null)));
0058: class exposed___getitem__ extends PyBuiltinMethodNarrow {
0059:
0060: exposed___getitem__(PyObject self,
0061: PyBuiltinFunction.Info info) {
0062: super (self, info);
0063: }
0064:
0065: public PyBuiltinFunction bind(PyObject self) {
0066: return new exposed___getitem__(self, info);
0067: }
0068:
0069: public PyObject __call__(PyObject arg0) {
0070: PyObject ret = ((PyUnicode) self)
0071: .seq___finditem__(arg0);
0072: if (ret == null) {
0073: throw Py.IndexError("index out of range: " + arg0);
0074: }
0075: return ret;
0076: }
0077:
0078: }
0079: dict.__setitem__("__getitem__", new PyMethodDescr(
0080: "__getitem__", PyUnicode.class, 1, 1,
0081: new exposed___getitem__(null, null)));
0082: class exposed___getslice__ extends PyBuiltinMethodNarrow {
0083:
0084: exposed___getslice__(PyObject self,
0085: PyBuiltinFunction.Info info) {
0086: super (self, info);
0087: }
0088:
0089: public PyBuiltinFunction bind(PyObject self) {
0090: return new exposed___getslice__(self, info);
0091: }
0092:
0093: public PyObject __call__(PyObject arg0, PyObject arg1,
0094: PyObject arg2) {
0095: return ((PyUnicode) self).seq___getslice__(arg0, arg1,
0096: arg2);
0097: }
0098:
0099: public PyObject __call__(PyObject arg0, PyObject arg1) {
0100: return ((PyUnicode) self).seq___getslice__(arg0, arg1);
0101: }
0102:
0103: }
0104: dict.__setitem__("__getslice__", new PyMethodDescr(
0105: "__getslice__", PyUnicode.class, 2, 3,
0106: new exposed___getslice__(null, null)));
0107: class exposed___contains__ extends PyBuiltinMethodNarrow {
0108:
0109: exposed___contains__(PyObject self,
0110: PyBuiltinFunction.Info info) {
0111: super (self, info);
0112: }
0113:
0114: public PyBuiltinFunction bind(PyObject self) {
0115: return new exposed___contains__(self, info);
0116: }
0117:
0118: public PyObject __call__(PyObject arg0) {
0119: return Py.newBoolean(((PyUnicode) self)
0120: .unicode___contains__(arg0));
0121: }
0122:
0123: }
0124: dict.__setitem__("__contains__", new PyMethodDescr(
0125: "__contains__", PyUnicode.class, 1, 1,
0126: new exposed___contains__(null, null)));
0127: class exposed___len__ extends PyBuiltinMethodNarrow {
0128:
0129: exposed___len__(PyObject self, PyBuiltinFunction.Info info) {
0130: super (self, info);
0131: }
0132:
0133: public PyBuiltinFunction bind(PyObject self) {
0134: return new exposed___len__(self, info);
0135: }
0136:
0137: public PyObject __call__() {
0138: return Py.newInteger(((PyUnicode) self)
0139: .unicode___len__());
0140: }
0141:
0142: }
0143: dict
0144: .__setitem__("__len__", new PyMethodDescr("__len__",
0145: PyUnicode.class, 0, 0, new exposed___len__(
0146: null, null)));
0147: class exposed___add__ extends PyBuiltinMethodNarrow {
0148:
0149: exposed___add__(PyObject self, PyBuiltinFunction.Info info) {
0150: super (self, info);
0151: }
0152:
0153: public PyBuiltinFunction bind(PyObject self) {
0154: return new exposed___add__(self, info);
0155: }
0156:
0157: public PyObject __call__(PyObject arg0) {
0158: return ((PyUnicode) self).unicode___add__(arg0);
0159: }
0160:
0161: }
0162: dict
0163: .__setitem__("__add__", new PyMethodDescr("__add__",
0164: PyUnicode.class, 1, 1, new exposed___add__(
0165: null, null)));
0166: class exposed___mul__ extends PyBuiltinMethodNarrow {
0167:
0168: exposed___mul__(PyObject self, PyBuiltinFunction.Info info) {
0169: super (self, info);
0170: }
0171:
0172: public PyBuiltinFunction bind(PyObject self) {
0173: return new exposed___mul__(self, info);
0174: }
0175:
0176: public PyObject __call__(PyObject arg0) {
0177: return ((PyUnicode) self).unicode___mul__(arg0);
0178: }
0179:
0180: }
0181: dict
0182: .__setitem__("__mul__", new PyMethodDescr("__mul__",
0183: PyUnicode.class, 1, 1, new exposed___mul__(
0184: null, null)));
0185: class exposed___rmul__ extends PyBuiltinMethodNarrow {
0186:
0187: exposed___rmul__(PyObject self, PyBuiltinFunction.Info info) {
0188: super (self, info);
0189: }
0190:
0191: public PyBuiltinFunction bind(PyObject self) {
0192: return new exposed___rmul__(self, info);
0193: }
0194:
0195: public PyObject __call__(PyObject arg0) {
0196: return ((PyUnicode) self).unicode___rmul__(arg0);
0197: }
0198:
0199: }
0200: dict.__setitem__("__rmul__",
0201: new PyMethodDescr("__rmul__", PyUnicode.class, 1, 1,
0202: new exposed___rmul__(null, null)));
0203: class exposed___str__ extends PyBuiltinMethodNarrow {
0204:
0205: exposed___str__(PyObject self, PyBuiltinFunction.Info info) {
0206: super (self, info);
0207: }
0208:
0209: public PyBuiltinFunction bind(PyObject self) {
0210: return new exposed___str__(self, info);
0211: }
0212:
0213: public PyObject __call__() {
0214: return ((PyUnicode) self).unicode___str__();
0215: }
0216:
0217: }
0218: dict
0219: .__setitem__("__str__", new PyMethodDescr("__str__",
0220: PyUnicode.class, 0, 0, new exposed___str__(
0221: null, null)));
0222: class exposed___unicode__ extends PyBuiltinMethodNarrow {
0223:
0224: exposed___unicode__(PyObject self,
0225: PyBuiltinFunction.Info info) {
0226: super (self, info);
0227: }
0228:
0229: public PyBuiltinFunction bind(PyObject self) {
0230: return new exposed___unicode__(self, info);
0231: }
0232:
0233: public PyObject __call__() {
0234: return ((PyUnicode) self).unicode___unicode__();
0235: }
0236:
0237: }
0238: dict.__setitem__("__unicode__", new PyMethodDescr(
0239: "__unicode__", PyUnicode.class, 0, 0,
0240: new exposed___unicode__(null, null)));
0241: class exposed___hash__ extends PyBuiltinMethodNarrow {
0242:
0243: exposed___hash__(PyObject self, PyBuiltinFunction.Info info) {
0244: super (self, info);
0245: }
0246:
0247: public PyBuiltinFunction bind(PyObject self) {
0248: return new exposed___hash__(self, info);
0249: }
0250:
0251: public PyObject __call__() {
0252: return Py.newInteger(((PyUnicode) self)
0253: .unicode_hashCode());
0254: }
0255:
0256: }
0257: dict.__setitem__("__hash__",
0258: new PyMethodDescr("__hash__", PyUnicode.class, 0, 0,
0259: new exposed___hash__(null, null)));
0260: class exposed___repr__ extends PyBuiltinMethodNarrow {
0261:
0262: exposed___repr__(PyObject self, PyBuiltinFunction.Info info) {
0263: super (self, info);
0264: }
0265:
0266: public PyBuiltinFunction bind(PyObject self) {
0267: return new exposed___repr__(self, info);
0268: }
0269:
0270: public PyObject __call__() {
0271: return new PyString(((PyUnicode) self)
0272: .unicode_toString());
0273: }
0274:
0275: }
0276: dict.__setitem__("__repr__",
0277: new PyMethodDescr("__repr__", PyUnicode.class, 0, 0,
0278: new exposed___repr__(null, null)));
0279: class exposed_capitalize extends PyBuiltinMethodNarrow {
0280:
0281: exposed_capitalize(PyObject self,
0282: PyBuiltinFunction.Info info) {
0283: super (self, info);
0284: }
0285:
0286: public PyBuiltinFunction bind(PyObject self) {
0287: return new exposed_capitalize(self, info);
0288: }
0289:
0290: public PyObject __call__() {
0291: return new PyUnicode(((PyUnicode) self)
0292: .unicode_capitalize());
0293: }
0294:
0295: }
0296: dict.__setitem__("capitalize", new PyMethodDescr("capitalize",
0297: PyUnicode.class, 0, 0, new exposed_capitalize(null,
0298: null)));
0299: class exposed_center extends PyBuiltinMethodNarrow {
0300:
0301: exposed_center(PyObject self, PyBuiltinFunction.Info info) {
0302: super (self, info);
0303: }
0304:
0305: public PyBuiltinFunction bind(PyObject self) {
0306: return new exposed_center(self, info);
0307: }
0308:
0309: public PyObject __call__(PyObject arg0) {
0310: try {
0311: return new PyUnicode(((PyUnicode) self)
0312: .unicode_center(arg0.asInt(0)));
0313: } catch (PyObject.ConversionException e) {
0314: String msg;
0315: switch (e.index) {
0316: case 0:
0317: msg = "expected an integer";
0318: break;
0319: default:
0320: msg = "xxx";
0321: }
0322: throw Py.TypeError(msg);
0323: }
0324: }
0325:
0326: }
0327: dict.__setitem__("center", new PyMethodDescr("center",
0328: PyUnicode.class, 1, 1, new exposed_center(null, null)));
0329: class exposed_count extends PyBuiltinMethodNarrow {
0330:
0331: exposed_count(PyObject self, PyBuiltinFunction.Info info) {
0332: super (self, info);
0333: }
0334:
0335: public PyBuiltinFunction bind(PyObject self) {
0336: return new exposed_count(self, info);
0337: }
0338:
0339: public PyObject __call__(PyObject arg0, PyObject arg1,
0340: PyObject arg2) {
0341: try {
0342: return Py.newInteger(((PyUnicode) self)
0343: .unicode_count(arg0.asString(0), arg1
0344: .asInt(1), arg2.asInt(2)));
0345: } catch (PyObject.ConversionException e) {
0346: String msg;
0347: switch (e.index) {
0348: case 1:
0349: case 2:
0350: msg = "expected an integer";
0351: break;
0352: case 0:
0353: msg = "expected a string";
0354: break;
0355: default:
0356: msg = "xxx";
0357: }
0358: throw Py.TypeError(msg);
0359: }
0360: }
0361:
0362: public PyObject __call__(PyObject arg0, PyObject arg1) {
0363: try {
0364: return Py.newInteger(((PyUnicode) self)
0365: .unicode_count(arg0.asString(0), arg1
0366: .asInt(1)));
0367: } catch (PyObject.ConversionException e) {
0368: String msg;
0369: switch (e.index) {
0370: case 1:
0371: msg = "expected an integer";
0372: break;
0373: case 0:
0374: msg = "expected a string";
0375: break;
0376: default:
0377: msg = "xxx";
0378: }
0379: throw Py.TypeError(msg);
0380: }
0381: }
0382:
0383: public PyObject __call__(PyObject arg0) {
0384: try {
0385: return Py.newInteger(((PyUnicode) self)
0386: .unicode_count(arg0.asString(0)));
0387: } catch (PyObject.ConversionException e) {
0388: String msg;
0389: switch (e.index) {
0390: case 0:
0391: msg = "expected a string";
0392: break;
0393: default:
0394: msg = "xxx";
0395: }
0396: throw Py.TypeError(msg);
0397: }
0398: }
0399:
0400: }
0401: dict.__setitem__("count", new PyMethodDescr("count",
0402: PyUnicode.class, 1, 3, new exposed_count(null, null)));
0403: class exposed_decode extends PyBuiltinMethodNarrow {
0404:
0405: exposed_decode(PyObject self, PyBuiltinFunction.Info info) {
0406: super (self, info);
0407: }
0408:
0409: public PyBuiltinFunction bind(PyObject self) {
0410: return new exposed_decode(self, info);
0411: }
0412:
0413: public PyObject __call__(PyObject arg0, PyObject arg1) {
0414: try {
0415: return new PyUnicode(((PyUnicode) self)
0416: .unicode_decode(arg0.asString(0), arg1
0417: .asString(1)));
0418: } catch (PyObject.ConversionException e) {
0419: String msg;
0420: switch (e.index) {
0421: case 0:
0422: case 1:
0423: msg = "expected a string";
0424: break;
0425: default:
0426: msg = "xxx";
0427: }
0428: throw Py.TypeError(msg);
0429: }
0430: }
0431:
0432: public PyObject __call__(PyObject arg0) {
0433: try {
0434: return new PyUnicode(((PyUnicode) self)
0435: .unicode_decode(arg0.asString(0)));
0436: } catch (PyObject.ConversionException e) {
0437: String msg;
0438: switch (e.index) {
0439: case 0:
0440: msg = "expected a string";
0441: break;
0442: default:
0443: msg = "xxx";
0444: }
0445: throw Py.TypeError(msg);
0446: }
0447: }
0448:
0449: public PyObject __call__() {
0450: return new PyUnicode(((PyUnicode) self)
0451: .unicode_decode());
0452: }
0453:
0454: }
0455: dict.__setitem__("decode", new PyMethodDescr("decode",
0456: PyUnicode.class, 0, 2, new exposed_decode(null, null)));
0457: class exposed_encode extends PyBuiltinMethodNarrow {
0458:
0459: exposed_encode(PyObject self, PyBuiltinFunction.Info info) {
0460: super (self, info);
0461: }
0462:
0463: public PyBuiltinFunction bind(PyObject self) {
0464: return new exposed_encode(self, info);
0465: }
0466:
0467: public PyObject __call__(PyObject arg0, PyObject arg1) {
0468: try {
0469: return new PyString(((PyUnicode) self)
0470: .unicode_encode(arg0.asString(0), arg1
0471: .asString(1)));
0472: } catch (PyObject.ConversionException e) {
0473: String msg;
0474: switch (e.index) {
0475: case 0:
0476: case 1:
0477: msg = "expected a string";
0478: break;
0479: default:
0480: msg = "xxx";
0481: }
0482: throw Py.TypeError(msg);
0483: }
0484: }
0485:
0486: public PyObject __call__(PyObject arg0) {
0487: try {
0488: return new PyString(((PyUnicode) self)
0489: .unicode_encode(arg0.asString(0)));
0490: } catch (PyObject.ConversionException e) {
0491: String msg;
0492: switch (e.index) {
0493: case 0:
0494: msg = "expected a string";
0495: break;
0496: default:
0497: msg = "xxx";
0498: }
0499: throw Py.TypeError(msg);
0500: }
0501: }
0502:
0503: public PyObject __call__() {
0504: return new PyString(((PyUnicode) self).unicode_encode());
0505: }
0506:
0507: }
0508: dict.__setitem__("encode", new PyMethodDescr("encode",
0509: PyUnicode.class, 0, 2, new exposed_encode(null, null)));
0510: class exposed_endswith extends PyBuiltinMethodNarrow {
0511:
0512: exposed_endswith(PyObject self, PyBuiltinFunction.Info info) {
0513: super (self, info);
0514: }
0515:
0516: public PyBuiltinFunction bind(PyObject self) {
0517: return new exposed_endswith(self, info);
0518: }
0519:
0520: public PyObject __call__(PyObject arg0, PyObject arg1,
0521: PyObject arg2) {
0522: try {
0523: return Py.newBoolean(((PyUnicode) self)
0524: .unicode_endswith(arg0.asString(0), arg1
0525: .asInt(1), arg2.asInt(2)));
0526: } catch (PyObject.ConversionException e) {
0527: String msg;
0528: switch (e.index) {
0529: case 1:
0530: case 2:
0531: msg = "expected an integer";
0532: break;
0533: case 0:
0534: msg = "expected a string";
0535: break;
0536: default:
0537: msg = "xxx";
0538: }
0539: throw Py.TypeError(msg);
0540: }
0541: }
0542:
0543: public PyObject __call__(PyObject arg0, PyObject arg1) {
0544: try {
0545: return Py.newBoolean(((PyUnicode) self)
0546: .unicode_endswith(arg0.asString(0), arg1
0547: .asInt(1)));
0548: } catch (PyObject.ConversionException e) {
0549: String msg;
0550: switch (e.index) {
0551: case 1:
0552: msg = "expected an integer";
0553: break;
0554: case 0:
0555: msg = "expected a string";
0556: break;
0557: default:
0558: msg = "xxx";
0559: }
0560: throw Py.TypeError(msg);
0561: }
0562: }
0563:
0564: public PyObject __call__(PyObject arg0) {
0565: try {
0566: return Py.newBoolean(((PyUnicode) self)
0567: .unicode_endswith(arg0.asString(0)));
0568: } catch (PyObject.ConversionException e) {
0569: String msg;
0570: switch (e.index) {
0571: case 0:
0572: msg = "expected a string";
0573: break;
0574: default:
0575: msg = "xxx";
0576: }
0577: throw Py.TypeError(msg);
0578: }
0579: }
0580:
0581: }
0582: dict.__setitem__("endswith",
0583: new PyMethodDescr("endswith", PyUnicode.class, 1, 3,
0584: new exposed_endswith(null, null)));
0585: class exposed_expandtabs extends PyBuiltinMethodNarrow {
0586:
0587: exposed_expandtabs(PyObject self,
0588: PyBuiltinFunction.Info info) {
0589: super (self, info);
0590: }
0591:
0592: public PyBuiltinFunction bind(PyObject self) {
0593: return new exposed_expandtabs(self, info);
0594: }
0595:
0596: public PyObject __call__(PyObject arg0) {
0597: try {
0598: return new PyUnicode(((PyUnicode) self)
0599: .unicode_expandtabs(arg0.asInt(0)));
0600: } catch (PyObject.ConversionException e) {
0601: String msg;
0602: switch (e.index) {
0603: case 0:
0604: msg = "expected an integer";
0605: break;
0606: default:
0607: msg = "xxx";
0608: }
0609: throw Py.TypeError(msg);
0610: }
0611: }
0612:
0613: public PyObject __call__() {
0614: return new PyUnicode(((PyUnicode) self)
0615: .unicode_expandtabs());
0616: }
0617:
0618: }
0619: dict.__setitem__("expandtabs", new PyMethodDescr("expandtabs",
0620: PyUnicode.class, 0, 1, new exposed_expandtabs(null,
0621: null)));
0622: class exposed_find extends PyBuiltinMethodNarrow {
0623:
0624: exposed_find(PyObject self, PyBuiltinFunction.Info info) {
0625: super (self, info);
0626: }
0627:
0628: public PyBuiltinFunction bind(PyObject self) {
0629: return new exposed_find(self, info);
0630: }
0631:
0632: public PyObject __call__(PyObject arg0, PyObject arg1,
0633: PyObject arg2) {
0634: try {
0635: return Py.newInteger(((PyUnicode) self)
0636: .unicode_find(arg0.asString(0), arg1
0637: .asInt(1), arg2.asInt(2)));
0638: } catch (PyObject.ConversionException e) {
0639: String msg;
0640: switch (e.index) {
0641: case 1:
0642: case 2:
0643: msg = "expected an integer";
0644: break;
0645: case 0:
0646: msg = "expected a string";
0647: break;
0648: default:
0649: msg = "xxx";
0650: }
0651: throw Py.TypeError(msg);
0652: }
0653: }
0654:
0655: public PyObject __call__(PyObject arg0, PyObject arg1) {
0656: try {
0657: return Py.newInteger(((PyUnicode) self)
0658: .unicode_find(arg0.asString(0), arg1
0659: .asInt(1)));
0660: } catch (PyObject.ConversionException e) {
0661: String msg;
0662: switch (e.index) {
0663: case 1:
0664: msg = "expected an integer";
0665: break;
0666: case 0:
0667: msg = "expected a string";
0668: break;
0669: default:
0670: msg = "xxx";
0671: }
0672: throw Py.TypeError(msg);
0673: }
0674: }
0675:
0676: public PyObject __call__(PyObject arg0) {
0677: try {
0678: return Py.newInteger(((PyUnicode) self)
0679: .unicode_find(arg0.asString(0)));
0680: } catch (PyObject.ConversionException e) {
0681: String msg;
0682: switch (e.index) {
0683: case 0:
0684: msg = "expected a string";
0685: break;
0686: default:
0687: msg = "xxx";
0688: }
0689: throw Py.TypeError(msg);
0690: }
0691: }
0692:
0693: }
0694: dict.__setitem__("find", new PyMethodDescr("find",
0695: PyUnicode.class, 1, 3, new exposed_find(null, null)));
0696: class exposed_index extends PyBuiltinMethodNarrow {
0697:
0698: exposed_index(PyObject self, PyBuiltinFunction.Info info) {
0699: super (self, info);
0700: }
0701:
0702: public PyBuiltinFunction bind(PyObject self) {
0703: return new exposed_index(self, info);
0704: }
0705:
0706: public PyObject __call__(PyObject arg0, PyObject arg1,
0707: PyObject arg2) {
0708: try {
0709: return Py.newInteger(((PyUnicode) self)
0710: .unicode_index(arg0.asString(0), arg1
0711: .asInt(1), arg2.asInt(2)));
0712: } catch (PyObject.ConversionException e) {
0713: String msg;
0714: switch (e.index) {
0715: case 1:
0716: case 2:
0717: msg = "expected an integer";
0718: break;
0719: case 0:
0720: msg = "expected a string";
0721: break;
0722: default:
0723: msg = "xxx";
0724: }
0725: throw Py.TypeError(msg);
0726: }
0727: }
0728:
0729: public PyObject __call__(PyObject arg0, PyObject arg1) {
0730: try {
0731: return Py.newInteger(((PyUnicode) self)
0732: .unicode_index(arg0.asString(0), arg1
0733: .asInt(1)));
0734: } catch (PyObject.ConversionException e) {
0735: String msg;
0736: switch (e.index) {
0737: case 1:
0738: msg = "expected an integer";
0739: break;
0740: case 0:
0741: msg = "expected a string";
0742: break;
0743: default:
0744: msg = "xxx";
0745: }
0746: throw Py.TypeError(msg);
0747: }
0748: }
0749:
0750: public PyObject __call__(PyObject arg0) {
0751: try {
0752: return Py.newInteger(((PyUnicode) self)
0753: .unicode_index(arg0.asString(0)));
0754: } catch (PyObject.ConversionException e) {
0755: String msg;
0756: switch (e.index) {
0757: case 0:
0758: msg = "expected a string";
0759: break;
0760: default:
0761: msg = "xxx";
0762: }
0763: throw Py.TypeError(msg);
0764: }
0765: }
0766:
0767: }
0768: dict.__setitem__("index", new PyMethodDescr("index",
0769: PyUnicode.class, 1, 3, new exposed_index(null, null)));
0770: class exposed_isalnum extends PyBuiltinMethodNarrow {
0771:
0772: exposed_isalnum(PyObject self, PyBuiltinFunction.Info info) {
0773: super (self, info);
0774: }
0775:
0776: public PyBuiltinFunction bind(PyObject self) {
0777: return new exposed_isalnum(self, info);
0778: }
0779:
0780: public PyObject __call__() {
0781: return Py.newBoolean(((PyUnicode) self)
0782: .unicode_isalnum());
0783: }
0784:
0785: }
0786: dict
0787: .__setitem__("isalnum", new PyMethodDescr("isalnum",
0788: PyUnicode.class, 0, 0, new exposed_isalnum(
0789: null, null)));
0790: class exposed_isalpha extends PyBuiltinMethodNarrow {
0791:
0792: exposed_isalpha(PyObject self, PyBuiltinFunction.Info info) {
0793: super (self, info);
0794: }
0795:
0796: public PyBuiltinFunction bind(PyObject self) {
0797: return new exposed_isalpha(self, info);
0798: }
0799:
0800: public PyObject __call__() {
0801: return Py.newBoolean(((PyUnicode) self)
0802: .unicode_isalpha());
0803: }
0804:
0805: }
0806: dict
0807: .__setitem__("isalpha", new PyMethodDescr("isalpha",
0808: PyUnicode.class, 0, 0, new exposed_isalpha(
0809: null, null)));
0810: class exposed_isdecimal extends PyBuiltinMethodNarrow {
0811:
0812: exposed_isdecimal(PyObject self, PyBuiltinFunction.Info info) {
0813: super (self, info);
0814: }
0815:
0816: public PyBuiltinFunction bind(PyObject self) {
0817: return new exposed_isdecimal(self, info);
0818: }
0819:
0820: public PyObject __call__() {
0821: return Py.newBoolean(((PyUnicode) self)
0822: .unicode_isdecimal());
0823: }
0824:
0825: }
0826: dict.__setitem__("isdecimal", new PyMethodDescr("isdecimal",
0827: PyUnicode.class, 0, 0,
0828: new exposed_isdecimal(null, null)));
0829: class exposed_isdigit extends PyBuiltinMethodNarrow {
0830:
0831: exposed_isdigit(PyObject self, PyBuiltinFunction.Info info) {
0832: super (self, info);
0833: }
0834:
0835: public PyBuiltinFunction bind(PyObject self) {
0836: return new exposed_isdigit(self, info);
0837: }
0838:
0839: public PyObject __call__() {
0840: return Py.newBoolean(((PyUnicode) self)
0841: .unicode_isdigit());
0842: }
0843:
0844: }
0845: dict
0846: .__setitem__("isdigit", new PyMethodDescr("isdigit",
0847: PyUnicode.class, 0, 0, new exposed_isdigit(
0848: null, null)));
0849: class exposed_islower extends PyBuiltinMethodNarrow {
0850:
0851: exposed_islower(PyObject self, PyBuiltinFunction.Info info) {
0852: super (self, info);
0853: }
0854:
0855: public PyBuiltinFunction bind(PyObject self) {
0856: return new exposed_islower(self, info);
0857: }
0858:
0859: public PyObject __call__() {
0860: return Py.newBoolean(((PyUnicode) self)
0861: .unicode_islower());
0862: }
0863:
0864: }
0865: dict
0866: .__setitem__("islower", new PyMethodDescr("islower",
0867: PyUnicode.class, 0, 0, new exposed_islower(
0868: null, null)));
0869: class exposed_isnumeric extends PyBuiltinMethodNarrow {
0870:
0871: exposed_isnumeric(PyObject self, PyBuiltinFunction.Info info) {
0872: super (self, info);
0873: }
0874:
0875: public PyBuiltinFunction bind(PyObject self) {
0876: return new exposed_isnumeric(self, info);
0877: }
0878:
0879: public PyObject __call__() {
0880: return Py.newBoolean(((PyUnicode) self)
0881: .unicode_isnumeric());
0882: }
0883:
0884: }
0885: dict.__setitem__("isnumeric", new PyMethodDescr("isnumeric",
0886: PyUnicode.class, 0, 0,
0887: new exposed_isnumeric(null, null)));
0888: class exposed_isspace extends PyBuiltinMethodNarrow {
0889:
0890: exposed_isspace(PyObject self, PyBuiltinFunction.Info info) {
0891: super (self, info);
0892: }
0893:
0894: public PyBuiltinFunction bind(PyObject self) {
0895: return new exposed_isspace(self, info);
0896: }
0897:
0898: public PyObject __call__() {
0899: return Py.newBoolean(((PyUnicode) self)
0900: .unicode_isspace());
0901: }
0902:
0903: }
0904: dict
0905: .__setitem__("isspace", new PyMethodDescr("isspace",
0906: PyUnicode.class, 0, 0, new exposed_isspace(
0907: null, null)));
0908: class exposed_istitle extends PyBuiltinMethodNarrow {
0909:
0910: exposed_istitle(PyObject self, PyBuiltinFunction.Info info) {
0911: super (self, info);
0912: }
0913:
0914: public PyBuiltinFunction bind(PyObject self) {
0915: return new exposed_istitle(self, info);
0916: }
0917:
0918: public PyObject __call__() {
0919: return Py.newBoolean(((PyUnicode) self)
0920: .unicode_istitle());
0921: }
0922:
0923: }
0924: dict
0925: .__setitem__("istitle", new PyMethodDescr("istitle",
0926: PyUnicode.class, 0, 0, new exposed_istitle(
0927: null, null)));
0928: class exposed_isunicode extends PyBuiltinMethodNarrow {
0929:
0930: exposed_isunicode(PyObject self, PyBuiltinFunction.Info info) {
0931: super (self, info);
0932: }
0933:
0934: public PyBuiltinFunction bind(PyObject self) {
0935: return new exposed_isunicode(self, info);
0936: }
0937:
0938: public PyObject __call__() {
0939: return Py.newBoolean(((PyUnicode) self)
0940: .unicode_isunicode());
0941: }
0942:
0943: }
0944: dict.__setitem__("isunicode", new PyMethodDescr("isunicode",
0945: PyUnicode.class, 0, 0,
0946: new exposed_isunicode(null, null)));
0947: class exposed_isupper extends PyBuiltinMethodNarrow {
0948:
0949: exposed_isupper(PyObject self, PyBuiltinFunction.Info info) {
0950: super (self, info);
0951: }
0952:
0953: public PyBuiltinFunction bind(PyObject self) {
0954: return new exposed_isupper(self, info);
0955: }
0956:
0957: public PyObject __call__() {
0958: return Py.newBoolean(((PyUnicode) self)
0959: .unicode_isupper());
0960: }
0961:
0962: }
0963: dict
0964: .__setitem__("isupper", new PyMethodDescr("isupper",
0965: PyUnicode.class, 0, 0, new exposed_isupper(
0966: null, null)));
0967: class exposed_join extends PyBuiltinMethodNarrow {
0968:
0969: exposed_join(PyObject self, PyBuiltinFunction.Info info) {
0970: super (self, info);
0971: }
0972:
0973: public PyBuiltinFunction bind(PyObject self) {
0974: return new exposed_join(self, info);
0975: }
0976:
0977: public PyObject __call__(PyObject arg0) {
0978: return new PyUnicode(((PyUnicode) self)
0979: .unicode_join(arg0));
0980: }
0981:
0982: }
0983: dict.__setitem__("join", new PyMethodDescr("join",
0984: PyUnicode.class, 1, 1, new exposed_join(null, null)));
0985: class exposed_ljust extends PyBuiltinMethodNarrow {
0986:
0987: exposed_ljust(PyObject self, PyBuiltinFunction.Info info) {
0988: super (self, info);
0989: }
0990:
0991: public PyBuiltinFunction bind(PyObject self) {
0992: return new exposed_ljust(self, info);
0993: }
0994:
0995: public PyObject __call__(PyObject arg0) {
0996: try {
0997: return new PyUnicode(((PyUnicode) self)
0998: .unicode_ljust(arg0.asInt(0)));
0999: } catch (PyObject.ConversionException e) {
1000: String msg;
1001: switch (e.index) {
1002: case 0:
1003: msg = "expected an integer";
1004: break;
1005: default:
1006: msg = "xxx";
1007: }
1008: throw Py.TypeError(msg);
1009: }
1010: }
1011:
1012: }
1013: dict.__setitem__("ljust", new PyMethodDescr("ljust",
1014: PyUnicode.class, 1, 1, new exposed_ljust(null, null)));
1015: class exposed_lower extends PyBuiltinMethodNarrow {
1016:
1017: exposed_lower(PyObject self, PyBuiltinFunction.Info info) {
1018: super (self, info);
1019: }
1020:
1021: public PyBuiltinFunction bind(PyObject self) {
1022: return new exposed_lower(self, info);
1023: }
1024:
1025: public PyObject __call__() {
1026: return new PyUnicode(((PyUnicode) self).unicode_lower());
1027: }
1028:
1029: }
1030: dict.__setitem__("lower", new PyMethodDescr("lower",
1031: PyUnicode.class, 0, 0, new exposed_lower(null, null)));
1032: class exposed_lstrip extends PyBuiltinMethodNarrow {
1033:
1034: exposed_lstrip(PyObject self, PyBuiltinFunction.Info info) {
1035: super (self, info);
1036: }
1037:
1038: public PyBuiltinFunction bind(PyObject self) {
1039: return new exposed_lstrip(self, info);
1040: }
1041:
1042: public PyObject __call__(PyObject arg0) {
1043: try {
1044: return new PyUnicode(((PyUnicode) self)
1045: .unicode_lstrip(arg0.asStringOrNull(0)));
1046: } catch (PyObject.ConversionException e) {
1047: String msg;
1048: switch (e.index) {
1049: case 0:
1050: msg = "expected a string or None";
1051: break;
1052: default:
1053: msg = "xxx";
1054: }
1055: throw Py.TypeError(msg);
1056: }
1057: }
1058:
1059: public PyObject __call__() {
1060: return new PyUnicode(((PyUnicode) self)
1061: .unicode_lstrip());
1062: }
1063:
1064: }
1065: dict.__setitem__("lstrip", new PyMethodDescr("lstrip",
1066: PyUnicode.class, 0, 1, new exposed_lstrip(null, null)));
1067: class exposed_replace extends PyBuiltinMethodNarrow {
1068:
1069: exposed_replace(PyObject self, PyBuiltinFunction.Info info) {
1070: super (self, info);
1071: }
1072:
1073: public PyBuiltinFunction bind(PyObject self) {
1074: return new exposed_replace(self, info);
1075: }
1076:
1077: public PyObject __call__(PyObject arg0, PyObject arg1,
1078: PyObject arg2) {
1079: try {
1080: return ((PyUnicode) self).unicode_replace(arg0,
1081: arg1, arg2.asInt(2));
1082: } catch (PyObject.ConversionException e) {
1083: String msg;
1084: switch (e.index) {
1085: case 2:
1086: msg = "expected an integer";
1087: break;
1088: default:
1089: msg = "xxx";
1090: }
1091: throw Py.TypeError(msg);
1092: }
1093: }
1094:
1095: public PyObject __call__(PyObject arg0, PyObject arg1) {
1096: return ((PyUnicode) self).unicode_replace(arg0, arg1);
1097: }
1098:
1099: }
1100: dict
1101: .__setitem__("replace", new PyMethodDescr("replace",
1102: PyUnicode.class, 2, 3, new exposed_replace(
1103: null, null)));
1104: class exposed_rfind extends PyBuiltinMethodNarrow {
1105:
1106: exposed_rfind(PyObject self, PyBuiltinFunction.Info info) {
1107: super (self, info);
1108: }
1109:
1110: public PyBuiltinFunction bind(PyObject self) {
1111: return new exposed_rfind(self, info);
1112: }
1113:
1114: public PyObject __call__(PyObject arg0, PyObject arg1,
1115: PyObject arg2) {
1116: try {
1117: return Py.newInteger(((PyUnicode) self)
1118: .unicode_rfind(arg0.asString(0), arg1
1119: .asInt(1), arg2.asInt(2)));
1120: } catch (PyObject.ConversionException e) {
1121: String msg;
1122: switch (e.index) {
1123: case 1:
1124: case 2:
1125: msg = "expected an integer";
1126: break;
1127: case 0:
1128: msg = "expected a string";
1129: break;
1130: default:
1131: msg = "xxx";
1132: }
1133: throw Py.TypeError(msg);
1134: }
1135: }
1136:
1137: public PyObject __call__(PyObject arg0, PyObject arg1) {
1138: try {
1139: return Py.newInteger(((PyUnicode) self)
1140: .unicode_rfind(arg0.asString(0), arg1
1141: .asInt(1)));
1142: } catch (PyObject.ConversionException e) {
1143: String msg;
1144: switch (e.index) {
1145: case 1:
1146: msg = "expected an integer";
1147: break;
1148: case 0:
1149: msg = "expected a string";
1150: break;
1151: default:
1152: msg = "xxx";
1153: }
1154: throw Py.TypeError(msg);
1155: }
1156: }
1157:
1158: public PyObject __call__(PyObject arg0) {
1159: try {
1160: return Py.newInteger(((PyUnicode) self)
1161: .unicode_rfind(arg0.asString(0)));
1162: } catch (PyObject.ConversionException e) {
1163: String msg;
1164: switch (e.index) {
1165: case 0:
1166: msg = "expected a string";
1167: break;
1168: default:
1169: msg = "xxx";
1170: }
1171: throw Py.TypeError(msg);
1172: }
1173: }
1174:
1175: }
1176: dict.__setitem__("rfind", new PyMethodDescr("rfind",
1177: PyUnicode.class, 1, 3, new exposed_rfind(null, null)));
1178: class exposed_rindex extends PyBuiltinMethodNarrow {
1179:
1180: exposed_rindex(PyObject self, PyBuiltinFunction.Info info) {
1181: super (self, info);
1182: }
1183:
1184: public PyBuiltinFunction bind(PyObject self) {
1185: return new exposed_rindex(self, info);
1186: }
1187:
1188: public PyObject __call__(PyObject arg0, PyObject arg1,
1189: PyObject arg2) {
1190: try {
1191: return Py.newInteger(((PyUnicode) self)
1192: .unicode_rindex(arg0.asString(0), arg1
1193: .asInt(1), arg2.asInt(2)));
1194: } catch (PyObject.ConversionException e) {
1195: String msg;
1196: switch (e.index) {
1197: case 1:
1198: case 2:
1199: msg = "expected an integer";
1200: break;
1201: case 0:
1202: msg = "expected a string";
1203: break;
1204: default:
1205: msg = "xxx";
1206: }
1207: throw Py.TypeError(msg);
1208: }
1209: }
1210:
1211: public PyObject __call__(PyObject arg0, PyObject arg1) {
1212: try {
1213: return Py.newInteger(((PyUnicode) self)
1214: .unicode_rindex(arg0.asString(0), arg1
1215: .asInt(1)));
1216: } catch (PyObject.ConversionException e) {
1217: String msg;
1218: switch (e.index) {
1219: case 1:
1220: msg = "expected an integer";
1221: break;
1222: case 0:
1223: msg = "expected a string";
1224: break;
1225: default:
1226: msg = "xxx";
1227: }
1228: throw Py.TypeError(msg);
1229: }
1230: }
1231:
1232: public PyObject __call__(PyObject arg0) {
1233: try {
1234: return Py.newInteger(((PyUnicode) self)
1235: .unicode_rindex(arg0.asString(0)));
1236: } catch (PyObject.ConversionException e) {
1237: String msg;
1238: switch (e.index) {
1239: case 0:
1240: msg = "expected a string";
1241: break;
1242: default:
1243: msg = "xxx";
1244: }
1245: throw Py.TypeError(msg);
1246: }
1247: }
1248:
1249: }
1250: dict.__setitem__("rindex", new PyMethodDescr("rindex",
1251: PyUnicode.class, 1, 3, new exposed_rindex(null, null)));
1252: class exposed_rjust extends PyBuiltinMethodNarrow {
1253:
1254: exposed_rjust(PyObject self, PyBuiltinFunction.Info info) {
1255: super (self, info);
1256: }
1257:
1258: public PyBuiltinFunction bind(PyObject self) {
1259: return new exposed_rjust(self, info);
1260: }
1261:
1262: public PyObject __call__(PyObject arg0) {
1263: try {
1264: return new PyUnicode(((PyUnicode) self)
1265: .unicode_rjust(arg0.asInt(0)));
1266: } catch (PyObject.ConversionException e) {
1267: String msg;
1268: switch (e.index) {
1269: case 0:
1270: msg = "expected an integer";
1271: break;
1272: default:
1273: msg = "xxx";
1274: }
1275: throw Py.TypeError(msg);
1276: }
1277: }
1278:
1279: }
1280: dict.__setitem__("rjust", new PyMethodDescr("rjust",
1281: PyUnicode.class, 1, 1, new exposed_rjust(null, null)));
1282: class exposed_rstrip extends PyBuiltinMethodNarrow {
1283:
1284: exposed_rstrip(PyObject self, PyBuiltinFunction.Info info) {
1285: super (self, info);
1286: }
1287:
1288: public PyBuiltinFunction bind(PyObject self) {
1289: return new exposed_rstrip(self, info);
1290: }
1291:
1292: public PyObject __call__(PyObject arg0) {
1293: try {
1294: return new PyUnicode(((PyUnicode) self)
1295: .unicode_rstrip(arg0.asStringOrNull(0)));
1296: } catch (PyObject.ConversionException e) {
1297: String msg;
1298: switch (e.index) {
1299: case 0:
1300: msg = "expected a string or None";
1301: break;
1302: default:
1303: msg = "xxx";
1304: }
1305: throw Py.TypeError(msg);
1306: }
1307: }
1308:
1309: public PyObject __call__() {
1310: return new PyUnicode(((PyUnicode) self)
1311: .unicode_rstrip());
1312: }
1313:
1314: }
1315: dict.__setitem__("rstrip", new PyMethodDescr("rstrip",
1316: PyUnicode.class, 0, 1, new exposed_rstrip(null, null)));
1317: class exposed_split extends PyBuiltinMethodNarrow {
1318:
1319: exposed_split(PyObject self, PyBuiltinFunction.Info info) {
1320: super (self, info);
1321: }
1322:
1323: public PyBuiltinFunction bind(PyObject self) {
1324: return new exposed_split(self, info);
1325: }
1326:
1327: public PyObject __call__(PyObject arg0, PyObject arg1) {
1328: try {
1329: return ((PyUnicode) self).unicode_split(arg0
1330: .asStringOrNull(0), arg1.asInt(1));
1331: } catch (PyObject.ConversionException e) {
1332: String msg;
1333: switch (e.index) {
1334: case 1:
1335: msg = "expected an integer";
1336: break;
1337: case 0:
1338: msg = "expected a string or None";
1339: break;
1340: default:
1341: msg = "xxx";
1342: }
1343: throw Py.TypeError(msg);
1344: }
1345: }
1346:
1347: public PyObject __call__(PyObject arg0) {
1348: try {
1349: return ((PyUnicode) self).unicode_split(arg0
1350: .asStringOrNull(0));
1351: } catch (PyObject.ConversionException e) {
1352: String msg;
1353: switch (e.index) {
1354: case 0:
1355: msg = "expected a string or None";
1356: break;
1357: default:
1358: msg = "xxx";
1359: }
1360: throw Py.TypeError(msg);
1361: }
1362: }
1363:
1364: public PyObject __call__() {
1365: return ((PyUnicode) self).unicode_split();
1366: }
1367:
1368: }
1369: dict.__setitem__("split", new PyMethodDescr("split",
1370: PyUnicode.class, 0, 2, new exposed_split(null, null)));
1371: class exposed_splitlines extends PyBuiltinMethodNarrow {
1372:
1373: exposed_splitlines(PyObject self,
1374: PyBuiltinFunction.Info info) {
1375: super (self, info);
1376: }
1377:
1378: public PyBuiltinFunction bind(PyObject self) {
1379: return new exposed_splitlines(self, info);
1380: }
1381:
1382: public PyObject __call__(PyObject arg0) {
1383: return ((PyUnicode) self).unicode_splitlines(arg0
1384: .__nonzero__());
1385: }
1386:
1387: public PyObject __call__() {
1388: return ((PyUnicode) self).unicode_splitlines();
1389: }
1390:
1391: }
1392: dict.__setitem__("splitlines", new PyMethodDescr("splitlines",
1393: PyUnicode.class, 0, 1, new exposed_splitlines(null,
1394: null)));
1395: class exposed_startswith extends PyBuiltinMethodNarrow {
1396:
1397: exposed_startswith(PyObject self,
1398: PyBuiltinFunction.Info info) {
1399: super (self, info);
1400: }
1401:
1402: public PyBuiltinFunction bind(PyObject self) {
1403: return new exposed_startswith(self, info);
1404: }
1405:
1406: public PyObject __call__(PyObject arg0, PyObject arg1,
1407: PyObject arg2) {
1408: try {
1409: return Py.newBoolean(((PyUnicode) self)
1410: .unicode_startswith(arg0.asString(0), arg1
1411: .asInt(1), arg2.asInt(2)));
1412: } catch (PyObject.ConversionException e) {
1413: String msg;
1414: switch (e.index) {
1415: case 1:
1416: case 2:
1417: msg = "expected an integer";
1418: break;
1419: case 0:
1420: msg = "expected a string";
1421: break;
1422: default:
1423: msg = "xxx";
1424: }
1425: throw Py.TypeError(msg);
1426: }
1427: }
1428:
1429: public PyObject __call__(PyObject arg0, PyObject arg1) {
1430: try {
1431: return Py.newBoolean(((PyUnicode) self)
1432: .unicode_startswith(arg0.asString(0), arg1
1433: .asInt(1)));
1434: } catch (PyObject.ConversionException e) {
1435: String msg;
1436: switch (e.index) {
1437: case 1:
1438: msg = "expected an integer";
1439: break;
1440: case 0:
1441: msg = "expected a string";
1442: break;
1443: default:
1444: msg = "xxx";
1445: }
1446: throw Py.TypeError(msg);
1447: }
1448: }
1449:
1450: public PyObject __call__(PyObject arg0) {
1451: try {
1452: return Py.newBoolean(((PyUnicode) self)
1453: .unicode_startswith(arg0.asString(0)));
1454: } catch (PyObject.ConversionException e) {
1455: String msg;
1456: switch (e.index) {
1457: case 0:
1458: msg = "expected a string";
1459: break;
1460: default:
1461: msg = "xxx";
1462: }
1463: throw Py.TypeError(msg);
1464: }
1465: }
1466:
1467: }
1468: dict.__setitem__("startswith", new PyMethodDescr("startswith",
1469: PyUnicode.class, 1, 3, new exposed_startswith(null,
1470: null)));
1471: class exposed_strip extends PyBuiltinMethodNarrow {
1472:
1473: exposed_strip(PyObject self, PyBuiltinFunction.Info info) {
1474: super (self, info);
1475: }
1476:
1477: public PyBuiltinFunction bind(PyObject self) {
1478: return new exposed_strip(self, info);
1479: }
1480:
1481: public PyObject __call__(PyObject arg0) {
1482: try {
1483: return new PyUnicode(((PyUnicode) self)
1484: .unicode_strip(arg0.asStringOrNull(0)));
1485: } catch (PyObject.ConversionException e) {
1486: String msg;
1487: switch (e.index) {
1488: case 0:
1489: msg = "expected a string or None";
1490: break;
1491: default:
1492: msg = "xxx";
1493: }
1494: throw Py.TypeError(msg);
1495: }
1496: }
1497:
1498: public PyObject __call__() {
1499: return new PyUnicode(((PyUnicode) self).unicode_strip());
1500: }
1501:
1502: }
1503: dict.__setitem__("strip", new PyMethodDescr("strip",
1504: PyUnicode.class, 0, 1, new exposed_strip(null, null)));
1505: class exposed_swapcase extends PyBuiltinMethodNarrow {
1506:
1507: exposed_swapcase(PyObject self, PyBuiltinFunction.Info info) {
1508: super (self, info);
1509: }
1510:
1511: public PyBuiltinFunction bind(PyObject self) {
1512: return new exposed_swapcase(self, info);
1513: }
1514:
1515: public PyObject __call__() {
1516: return new PyUnicode(((PyUnicode) self)
1517: .unicode_swapcase());
1518: }
1519:
1520: }
1521: dict.__setitem__("swapcase",
1522: new PyMethodDescr("swapcase", PyUnicode.class, 0, 0,
1523: new exposed_swapcase(null, null)));
1524: class exposed_title extends PyBuiltinMethodNarrow {
1525:
1526: exposed_title(PyObject self, PyBuiltinFunction.Info info) {
1527: super (self, info);
1528: }
1529:
1530: public PyBuiltinFunction bind(PyObject self) {
1531: return new exposed_title(self, info);
1532: }
1533:
1534: public PyObject __call__() {
1535: return new PyUnicode(((PyUnicode) self).unicode_title());
1536: }
1537:
1538: }
1539: dict.__setitem__("title", new PyMethodDescr("title",
1540: PyUnicode.class, 0, 0, new exposed_title(null, null)));
1541: class exposed_translate extends PyBuiltinMethodNarrow {
1542:
1543: exposed_translate(PyObject self, PyBuiltinFunction.Info info) {
1544: super (self, info);
1545: }
1546:
1547: public PyBuiltinFunction bind(PyObject self) {
1548: return new exposed_translate(self, info);
1549: }
1550:
1551: public PyObject __call__(PyObject arg0) {
1552: return new PyUnicode(((PyUnicode) self)
1553: .unicode_translate(arg0));
1554: }
1555:
1556: }
1557: dict.__setitem__("translate", new PyMethodDescr("translate",
1558: PyUnicode.class, 1, 1,
1559: new exposed_translate(null, null)));
1560: class exposed_upper extends PyBuiltinMethodNarrow {
1561:
1562: exposed_upper(PyObject self, PyBuiltinFunction.Info info) {
1563: super (self, info);
1564: }
1565:
1566: public PyBuiltinFunction bind(PyObject self) {
1567: return new exposed_upper(self, info);
1568: }
1569:
1570: public PyObject __call__() {
1571: return new PyUnicode(((PyUnicode) self).unicode_upper());
1572: }
1573:
1574: }
1575: dict.__setitem__("upper", new PyMethodDescr("upper",
1576: PyUnicode.class, 0, 0, new exposed_upper(null, null)));
1577: class exposed_zfill extends PyBuiltinMethodNarrow {
1578:
1579: exposed_zfill(PyObject self, PyBuiltinFunction.Info info) {
1580: super (self, info);
1581: }
1582:
1583: public PyBuiltinFunction bind(PyObject self) {
1584: return new exposed_zfill(self, info);
1585: }
1586:
1587: public PyObject __call__(PyObject arg0) {
1588: try {
1589: return new PyUnicode(((PyUnicode) self)
1590: .unicode_zfill(arg0.asInt(0)));
1591: } catch (PyObject.ConversionException e) {
1592: String msg;
1593: switch (e.index) {
1594: case 0:
1595: msg = "expected an integer";
1596: break;
1597: default:
1598: msg = "xxx";
1599: }
1600: throw Py.TypeError(msg);
1601: }
1602: }
1603:
1604: }
1605: dict.__setitem__("zfill", new PyMethodDescr("zfill",
1606: PyUnicode.class, 1, 1, new exposed_zfill(null, null)));
1607: dict.__setitem__("__new__", new PyNewWrapper(PyUnicode.class,
1608: "__new__", -1, -1) {
1609:
1610: public PyObject new_impl(boolean init, PyType subtype,
1611: PyObject[] args, String[] keywords) {
1612: return unicode_new(this , init, subtype, args, keywords);
1613: }
1614:
1615: });
1616: }
1617:
1618: //~ END GENERATED REGION -- DO NOT EDIT SEE gexpose.py
1619:
1620: //XXX: probably don't need these.
1621: //private String string;
1622: //private transient int cached_hashcode=0;
1623: //private transient boolean interned=false;
1624:
1625: private static final PyType UNICODETYPE = PyType
1626: .fromClass(PyUnicode.class);
1627:
1628: // for PyJavaClass.init()
1629: public PyUnicode() {
1630: this (UNICODETYPE, "");
1631: }
1632:
1633: public PyUnicode(String string) {
1634: this (UNICODETYPE, string);
1635: }
1636:
1637: public PyUnicode(PyType subtype, String string) {
1638: super (subtype, string);
1639: }
1640:
1641: public PyUnicode(PyString pystring) {
1642: this (UNICODETYPE, pystring);
1643: }
1644:
1645: public PyUnicode(PyType subtype, PyString pystring) {
1646: this (subtype, (String) pystring.__tojava__(String.class));
1647: }
1648:
1649: public PyUnicode(char c) {
1650: this (UNICODETYPE, String.valueOf(c));
1651: }
1652:
1653: final static PyObject unicode_new(PyNewWrapper new_, boolean init,
1654: PyType subtype, PyObject[] args, String[] keywords) {
1655: ArgParser ap = new ArgParser("unicode", args, keywords,
1656: new String[] { "string", "encoding", "errors" }, 0);
1657: PyObject S = ap.getPyObject(0, null);
1658: String encoding = ap.getString(1, null);
1659: String errors = ap.getString(2, null);
1660: if (new_.for_type == subtype) {
1661: if (S == null) {
1662: return new PyUnicode("");
1663: }
1664: if (S instanceof PyUnicode) {
1665: return S;
1666: }
1667: if (S instanceof PyString) {
1668: return new PyUnicode(codecs.decode((PyString) S,
1669: encoding, errors));
1670: }
1671: return S.__unicode__();
1672: } else {
1673: if (S == null) {
1674: return new PyUnicodeDerived(subtype, "");
1675: }
1676:
1677: return new PyUnicodeDerived(subtype,
1678: (String) ((S.__str__()).__tojava__(String.class)));
1679: }
1680: }
1681:
1682: /** <i>Internal use only. Do not call this method explicitly.</i> */
1683: public static void classDictInit(PyObject dict)
1684: throws PyIgnoreMethodTag {
1685: }
1686:
1687: public String safeRepr() throws PyIgnoreMethodTag {
1688: return "'unicode' object";
1689: }
1690:
1691: public PyString createInstance(String str) {
1692: return new PyUnicode(str);
1693: }
1694:
1695: public PyObject __mod__(PyObject other) {
1696: return str___mod__(other).__unicode__();
1697: }
1698:
1699: final PyUnicode unicode___unicode__() {
1700: return str___unicode__();
1701: }
1702:
1703: public PyString __str__() {
1704: return unicode___str__();
1705: }
1706:
1707: public PyString unicode___str__() {
1708: return new PyString(toString());
1709: }
1710:
1711: final int unicode___len__() {
1712: return str___len__();
1713: }
1714:
1715: public PyString __repr__() {
1716: return new PyString('u' + encode_UnicodeEscape(string, true,
1717: true));
1718: }
1719:
1720: public String unicode_toString() {
1721: return str_toString();
1722: }
1723:
1724: final int unicode___cmp__(PyObject other) {
1725: return str___cmp__(other);
1726: }
1727:
1728: final PyObject unicode___eq__(PyObject other) {
1729: return str___eq__(other);
1730: }
1731:
1732: final PyObject unicode___ne__(PyObject other) {
1733: return str___ne__(other);
1734: }
1735:
1736: final int unicode_hashCode() {
1737: return str_hashCode();
1738: }
1739:
1740: protected PyObject pyget(int i) {
1741: return Py.makeCharacter(string.charAt(i), true);
1742: }
1743:
1744: final boolean unicode___contains__(PyObject o) {
1745: return str___contains__(o);
1746: }
1747:
1748: final PyObject unicode___mul__(PyObject o) {
1749: return str___mul__(o);
1750: }
1751:
1752: final PyObject unicode___rmul__(PyObject o) {
1753: return str___rmul__(o);
1754: }
1755:
1756: final PyObject unicode___add__(PyObject generic_other) {
1757: return str___add__(generic_other);
1758: }
1759:
1760: final String unicode_lower() {
1761: return str_lower();
1762: }
1763:
1764: final String unicode_upper() {
1765: return str_upper();
1766: }
1767:
1768: final String unicode_title() {
1769: return str_title();
1770: }
1771:
1772: final String unicode_swapcase() {
1773: return str_swapcase();
1774: }
1775:
1776: final String unicode_strip() {
1777: return str_strip();
1778: }
1779:
1780: final String unicode_strip(String sep) {
1781: return str_strip(sep);
1782: }
1783:
1784: final String unicode_lstrip() {
1785: return str_lstrip();
1786: }
1787:
1788: final String unicode_lstrip(String sep) {
1789: return str_lstrip(sep);
1790: }
1791:
1792: final String unicode_rstrip() {
1793: return str_rstrip();
1794: }
1795:
1796: final String unicode_rstrip(String sep) {
1797: return str_rstrip(sep);
1798: }
1799:
1800: final PyList unicode_split() {
1801: return str_split();
1802: }
1803:
1804: final PyList unicode_split(String sep) {
1805: return str_split(sep);
1806: }
1807:
1808: final PyList unicode_split(String sep, int maxsplit) {
1809: return str_split(sep, maxsplit);
1810: }
1811:
1812: final PyList unicode_splitlines() {
1813: return str_splitlines();
1814: }
1815:
1816: final PyList unicode_splitlines(boolean keepends) {
1817: return str_splitlines(keepends);
1818: }
1819:
1820: protected PyString fromSubstring(int begin, int end) {
1821: return new PyUnicode(string.substring(begin, end));
1822: }
1823:
1824: final int unicode_index(String sub) {
1825: return str_index(sub);
1826: }
1827:
1828: final int unicode_index(String sub, int start) {
1829: return str_index(sub, start);
1830: }
1831:
1832: final int unicode_index(String sub, int start, int end) {
1833: return str_index(sub, start, end);
1834: }
1835:
1836: final int unicode_rindex(String sub) {
1837: return str_rindex(sub);
1838: }
1839:
1840: final int unicode_rindex(String sub, int start) {
1841: return str_rindex(sub, start);
1842: }
1843:
1844: final int unicode_rindex(String sub, int start, int end) {
1845: return str_rindex(sub, start, end);
1846: }
1847:
1848: final int unicode_count(String sub) {
1849: return str_count(sub);
1850: }
1851:
1852: final int unicode_count(String sub, int start) {
1853: return str_count(sub, start);
1854: }
1855:
1856: final int unicode_count(String sub, int start, int end) {
1857: return str_count(sub, start, end);
1858: }
1859:
1860: final int unicode_find(String sub) {
1861: return str_find(sub);
1862: }
1863:
1864: final int unicode_find(String sub, int start) {
1865: return str_find(sub, start);
1866: }
1867:
1868: final int unicode_find(String sub, int start, int end) {
1869: return str_find(sub, start, end);
1870: }
1871:
1872: final int unicode_rfind(String sub) {
1873: return str_rfind(sub);
1874: }
1875:
1876: final int unicode_rfind(String sub, int start) {
1877: return str_rfind(sub, start);
1878: }
1879:
1880: final int unicode_rfind(String sub, int start, int end) {
1881: return str_rfind(sub, start, end);
1882: }
1883:
1884: final String unicode_ljust(int width) {
1885: return str_ljust(width);
1886: }
1887:
1888: final String unicode_rjust(int width) {
1889: return str_rjust(width);
1890: }
1891:
1892: final String unicode_center(int width) {
1893: return str_center(width);
1894: }
1895:
1896: final String unicode_zfill(int width) {
1897: return str_zfill(width);
1898: }
1899:
1900: final String unicode_expandtabs() {
1901: return str_expandtabs();
1902: }
1903:
1904: final String unicode_expandtabs(int tabsize) {
1905: return str_expandtabs(tabsize);
1906: }
1907:
1908: final String unicode_capitalize() {
1909: return str_capitalize();
1910: }
1911:
1912: final PyObject unicode_replace(PyObject oldPiece, PyObject newPiece) {
1913: return str_replace(oldPiece, newPiece);
1914: }
1915:
1916: final PyObject unicode_replace(PyObject oldPiece,
1917: PyObject newPiece, int maxsplit) {
1918: return str_replace(oldPiece, newPiece, maxsplit);
1919: }
1920:
1921: final PyString unicode_join(PyObject seq) {
1922: return str_join(seq);
1923: }
1924:
1925: final boolean unicode_startswith(String prefix) {
1926: return str_startswith(prefix);
1927: }
1928:
1929: final boolean unicode_startswith(String prefix, int offset) {
1930: return str_startswith(prefix, offset);
1931: }
1932:
1933: final boolean unicode_startswith(String prefix, int start, int end) {
1934: return str_startswith(prefix, start, end);
1935: }
1936:
1937: final boolean unicode_endswith(String suffix) {
1938: return str_endswith(suffix);
1939: }
1940:
1941: final boolean unicode_endswith(String suffix, int start) {
1942: return str_endswith(suffix, start);
1943: }
1944:
1945: final boolean unicode_endswith(String suffix, int start, int end) {
1946: return str_endswith(suffix, start, end);
1947: }
1948:
1949: final String unicode_translate(PyObject table) {
1950: return _codecs.charmap_decode(string, "ignore", table)
1951: .__getitem__(0).toString();
1952: }
1953:
1954: final boolean unicode_islower() {
1955: return str_islower();
1956: }
1957:
1958: final boolean unicode_isupper() {
1959: return str_isupper();
1960: }
1961:
1962: final boolean unicode_isalpha() {
1963: return str_isalpha();
1964: }
1965:
1966: final boolean unicode_isalnum() {
1967: return str_isalnum();
1968: }
1969:
1970: final boolean unicode_isdecimal() {
1971: return str_isdecimal();
1972: }
1973:
1974: final boolean unicode_isdigit() {
1975: return str_isdigit();
1976: }
1977:
1978: final boolean unicode_isnumeric() {
1979: return str_isnumeric();
1980: }
1981:
1982: final boolean unicode_istitle() {
1983: return str_istitle();
1984: }
1985:
1986: final boolean unicode_isspace() {
1987: return str_isspace();
1988: }
1989:
1990: final boolean unicode_isunicode() {
1991: return true;
1992: }
1993:
1994: final String unicode_encode() {
1995: return str_encode();
1996: }
1997:
1998: final String unicode_encode(String encoding) {
1999: return str_encode(encoding);
2000: }
2001:
2002: final String unicode_encode(String encoding, String errors) {
2003: return str_encode(encoding, errors);
2004: }
2005:
2006: final String unicode_decode() {
2007: return str_decode();
2008: }
2009:
2010: final String unicode_decode(String encoding) {
2011: return str_decode(encoding);
2012: }
2013:
2014: final String unicode_decode(String encoding, String errors) {
2015: return str_decode(encoding, errors);
2016: }
2017:
2018: }
|