001: package org.python.modules.sets;
002:
003: import org.python.core.Py;
004: import org.python.core.PyBuiltinFunction;
005: import org.python.core.PyBuiltinMethod;
006: import org.python.core.PyBuiltinMethodNarrow;
007: import org.python.core.PyMethodDescr;
008: import org.python.core.PyNewWrapper;
009: import org.python.core.PyObject;
010: import org.python.core.PyString;
011: import org.python.core.PyType;
012:
013: public class PyImmutableSet extends BaseSet {
014: //~ BEGIN GENERATED REGION -- DO NOT EDIT SEE gexpose.py
015: /* type info */
016:
017: public static final String exposed_name = "ImmutableSet";
018:
019: public static final Class exposed_base = PyObject.class;
020:
021: public static void typeSetup(PyObject dict, PyType.Newstyle marker) {
022: class exposed___ne__ extends PyBuiltinMethodNarrow {
023:
024: exposed___ne__(PyObject self, PyBuiltinFunction.Info info) {
025: super (self, info);
026: }
027:
028: public PyBuiltinFunction bind(PyObject self) {
029: return new exposed___ne__(self, info);
030: }
031:
032: public PyObject __call__(PyObject arg0) {
033: PyObject ret = ((PyImmutableSet) self)
034: .baseset___ne__(arg0);
035: if (ret == null)
036: return Py.NotImplemented;
037: return ret;
038: }
039:
040: }
041: dict.__setitem__("__ne__", new PyMethodDescr("__ne__",
042: PyImmutableSet.class, 1, 1, new exposed___ne__(null,
043: null)));
044: class exposed___eq__ extends PyBuiltinMethodNarrow {
045:
046: exposed___eq__(PyObject self, PyBuiltinFunction.Info info) {
047: super (self, info);
048: }
049:
050: public PyBuiltinFunction bind(PyObject self) {
051: return new exposed___eq__(self, info);
052: }
053:
054: public PyObject __call__(PyObject arg0) {
055: PyObject ret = ((PyImmutableSet) self)
056: .baseset___eq__(arg0);
057: if (ret == null)
058: return Py.NotImplemented;
059: return ret;
060: }
061:
062: }
063: dict.__setitem__("__eq__", new PyMethodDescr("__eq__",
064: PyImmutableSet.class, 1, 1, new exposed___eq__(null,
065: null)));
066: class exposed___or__ extends PyBuiltinMethodNarrow {
067:
068: exposed___or__(PyObject self, PyBuiltinFunction.Info info) {
069: super (self, info);
070: }
071:
072: public PyBuiltinFunction bind(PyObject self) {
073: return new exposed___or__(self, info);
074: }
075:
076: public PyObject __call__(PyObject arg0) {
077: PyObject ret = ((PyImmutableSet) self)
078: .baseset___or__(arg0);
079: if (ret == null)
080: return Py.NotImplemented;
081: return ret;
082: }
083:
084: }
085: dict.__setitem__("__or__", new PyMethodDescr("__or__",
086: PyImmutableSet.class, 1, 1, new exposed___or__(null,
087: null)));
088: class exposed___xor__ extends PyBuiltinMethodNarrow {
089:
090: exposed___xor__(PyObject self, PyBuiltinFunction.Info info) {
091: super (self, info);
092: }
093:
094: public PyBuiltinFunction bind(PyObject self) {
095: return new exposed___xor__(self, info);
096: }
097:
098: public PyObject __call__(PyObject arg0) {
099: PyObject ret = ((PyImmutableSet) self)
100: .baseset___xor__(arg0);
101: if (ret == null)
102: return Py.NotImplemented;
103: return ret;
104: }
105:
106: }
107: dict.__setitem__("__xor__", new PyMethodDescr("__xor__",
108: PyImmutableSet.class, 1, 1, new exposed___xor__(null,
109: null)));
110: class exposed___sub__ extends PyBuiltinMethodNarrow {
111:
112: exposed___sub__(PyObject self, PyBuiltinFunction.Info info) {
113: super (self, info);
114: }
115:
116: public PyBuiltinFunction bind(PyObject self) {
117: return new exposed___sub__(self, info);
118: }
119:
120: public PyObject __call__(PyObject arg0) {
121: PyObject ret = ((PyImmutableSet) self)
122: .baseset___sub__(arg0);
123: if (ret == null)
124: return Py.NotImplemented;
125: return ret;
126: }
127:
128: }
129: dict.__setitem__("__sub__", new PyMethodDescr("__sub__",
130: PyImmutableSet.class, 1, 1, new exposed___sub__(null,
131: null)));
132: class exposed___and__ extends PyBuiltinMethodNarrow {
133:
134: exposed___and__(PyObject self, PyBuiltinFunction.Info info) {
135: super (self, info);
136: }
137:
138: public PyBuiltinFunction bind(PyObject self) {
139: return new exposed___and__(self, info);
140: }
141:
142: public PyObject __call__(PyObject arg0) {
143: PyObject ret = ((PyImmutableSet) self)
144: .baseset___and__(arg0);
145: if (ret == null)
146: return Py.NotImplemented;
147: return ret;
148: }
149:
150: }
151: dict.__setitem__("__and__", new PyMethodDescr("__and__",
152: PyImmutableSet.class, 1, 1, new exposed___and__(null,
153: null)));
154: class exposed___gt__ extends PyBuiltinMethodNarrow {
155:
156: exposed___gt__(PyObject self, PyBuiltinFunction.Info info) {
157: super (self, info);
158: }
159:
160: public PyBuiltinFunction bind(PyObject self) {
161: return new exposed___gt__(self, info);
162: }
163:
164: public PyObject __call__(PyObject arg0) {
165: PyObject ret = ((PyImmutableSet) self)
166: .baseset___gt__(arg0);
167: if (ret == null)
168: return Py.NotImplemented;
169: return ret;
170: }
171:
172: }
173: dict.__setitem__("__gt__", new PyMethodDescr("__gt__",
174: PyImmutableSet.class, 1, 1, new exposed___gt__(null,
175: null)));
176: class exposed___ge__ extends PyBuiltinMethodNarrow {
177:
178: exposed___ge__(PyObject self, PyBuiltinFunction.Info info) {
179: super (self, info);
180: }
181:
182: public PyBuiltinFunction bind(PyObject self) {
183: return new exposed___ge__(self, info);
184: }
185:
186: public PyObject __call__(PyObject arg0) {
187: PyObject ret = ((PyImmutableSet) self)
188: .baseset___ge__(arg0);
189: if (ret == null)
190: return Py.NotImplemented;
191: return ret;
192: }
193:
194: }
195: dict.__setitem__("__ge__", new PyMethodDescr("__ge__",
196: PyImmutableSet.class, 1, 1, new exposed___ge__(null,
197: null)));
198: class exposed___le__ extends PyBuiltinMethodNarrow {
199:
200: exposed___le__(PyObject self, PyBuiltinFunction.Info info) {
201: super (self, info);
202: }
203:
204: public PyBuiltinFunction bind(PyObject self) {
205: return new exposed___le__(self, info);
206: }
207:
208: public PyObject __call__(PyObject arg0) {
209: PyObject ret = ((PyImmutableSet) self)
210: .baseset___le__(arg0);
211: if (ret == null)
212: return Py.NotImplemented;
213: return ret;
214: }
215:
216: }
217: dict.__setitem__("__le__", new PyMethodDescr("__le__",
218: PyImmutableSet.class, 1, 1, new exposed___le__(null,
219: null)));
220: class exposed___lt__ extends PyBuiltinMethodNarrow {
221:
222: exposed___lt__(PyObject self, PyBuiltinFunction.Info info) {
223: super (self, info);
224: }
225:
226: public PyBuiltinFunction bind(PyObject self) {
227: return new exposed___lt__(self, info);
228: }
229:
230: public PyObject __call__(PyObject arg0) {
231: PyObject ret = ((PyImmutableSet) self)
232: .baseset___lt__(arg0);
233: if (ret == null)
234: return Py.NotImplemented;
235: return ret;
236: }
237:
238: }
239: dict.__setitem__("__lt__", new PyMethodDescr("__lt__",
240: PyImmutableSet.class, 1, 1, new exposed___lt__(null,
241: null)));
242: class exposed___contains__ extends PyBuiltinMethodNarrow {
243:
244: exposed___contains__(PyObject self,
245: PyBuiltinFunction.Info info) {
246: super (self, info);
247: }
248:
249: public PyBuiltinFunction bind(PyObject self) {
250: return new exposed___contains__(self, info);
251: }
252:
253: public PyObject __call__(PyObject arg0) {
254: return Py.newBoolean(((PyImmutableSet) self)
255: .baseset___contains__(arg0));
256: }
257:
258: }
259: dict.__setitem__("__contains__", new PyMethodDescr(
260: "__contains__", PyImmutableSet.class, 1, 1,
261: new exposed___contains__(null, null)));
262: class exposed___deepcopy__ extends PyBuiltinMethodNarrow {
263:
264: exposed___deepcopy__(PyObject self,
265: PyBuiltinFunction.Info info) {
266: super (self, info);
267: }
268:
269: public PyBuiltinFunction bind(PyObject self) {
270: return new exposed___deepcopy__(self, info);
271: }
272:
273: public PyObject __call__(PyObject arg0) {
274: return ((PyImmutableSet) self)
275: .baseset___deepcopy__(arg0);
276: }
277:
278: }
279: dict.__setitem__("__deepcopy__", new PyMethodDescr(
280: "__deepcopy__", PyImmutableSet.class, 1, 1,
281: new exposed___deepcopy__(null, null)));
282: class exposed___nonzero__ extends PyBuiltinMethodNarrow {
283:
284: exposed___nonzero__(PyObject self,
285: PyBuiltinFunction.Info info) {
286: super (self, info);
287: }
288:
289: public PyBuiltinFunction bind(PyObject self) {
290: return new exposed___nonzero__(self, info);
291: }
292:
293: public PyObject __call__() {
294: return Py.newBoolean(((PyImmutableSet) self)
295: .baseset___nonzero__());
296: }
297:
298: }
299: dict.__setitem__("__nonzero__", new PyMethodDescr(
300: "__nonzero__", PyImmutableSet.class, 0, 0,
301: new exposed___nonzero__(null, null)));
302: class exposed_copy extends PyBuiltinMethodNarrow {
303:
304: exposed_copy(PyObject self, PyBuiltinFunction.Info info) {
305: super (self, info);
306: }
307:
308: public PyBuiltinFunction bind(PyObject self) {
309: return new exposed_copy(self, info);
310: }
311:
312: public PyObject __call__() {
313: return ((PyImmutableSet) self).baseset_copy();
314: }
315:
316: }
317: dict.__setitem__("copy", new PyMethodDescr("copy",
318: PyImmutableSet.class, 0, 0,
319: new exposed_copy(null, null)));
320: class exposed_union extends PyBuiltinMethodNarrow {
321:
322: exposed_union(PyObject self, PyBuiltinFunction.Info info) {
323: super (self, info);
324: }
325:
326: public PyBuiltinFunction bind(PyObject self) {
327: return new exposed_union(self, info);
328: }
329:
330: public PyObject __call__(PyObject arg0) {
331: return ((PyImmutableSet) self).baseset_union(arg0);
332: }
333:
334: }
335: dict.__setitem__("union", new PyMethodDescr("union",
336: PyImmutableSet.class, 1, 1, new exposed_union(null,
337: null)));
338: class exposed_difference extends PyBuiltinMethodNarrow {
339:
340: exposed_difference(PyObject self,
341: PyBuiltinFunction.Info info) {
342: super (self, info);
343: }
344:
345: public PyBuiltinFunction bind(PyObject self) {
346: return new exposed_difference(self, info);
347: }
348:
349: public PyObject __call__(PyObject arg0) {
350: return ((PyImmutableSet) self).baseset_difference(arg0);
351: }
352:
353: }
354: dict.__setitem__("difference", new PyMethodDescr("difference",
355: PyImmutableSet.class, 1, 1, new exposed_difference(
356: null, null)));
357: class exposed_symmetric_difference extends
358: PyBuiltinMethodNarrow {
359:
360: exposed_symmetric_difference(PyObject self,
361: PyBuiltinFunction.Info info) {
362: super (self, info);
363: }
364:
365: public PyBuiltinFunction bind(PyObject self) {
366: return new exposed_symmetric_difference(self, info);
367: }
368:
369: public PyObject __call__(PyObject arg0) {
370: return ((PyImmutableSet) self)
371: .baseset_symmetric_difference(arg0);
372: }
373:
374: }
375: dict.__setitem__("symmetric_difference", new PyMethodDescr(
376: "symmetric_difference", PyImmutableSet.class, 1, 1,
377: new exposed_symmetric_difference(null, null)));
378: class exposed_intersection extends PyBuiltinMethodNarrow {
379:
380: exposed_intersection(PyObject self,
381: PyBuiltinFunction.Info info) {
382: super (self, info);
383: }
384:
385: public PyBuiltinFunction bind(PyObject self) {
386: return new exposed_intersection(self, info);
387: }
388:
389: public PyObject __call__(PyObject arg0) {
390: return ((PyImmutableSet) self)
391: .baseset_intersection(arg0);
392: }
393:
394: }
395: dict.__setitem__("intersection", new PyMethodDescr(
396: "intersection", PyImmutableSet.class, 1, 1,
397: new exposed_intersection(null, null)));
398: class exposed_issubset extends PyBuiltinMethodNarrow {
399:
400: exposed_issubset(PyObject self, PyBuiltinFunction.Info info) {
401: super (self, info);
402: }
403:
404: public PyBuiltinFunction bind(PyObject self) {
405: return new exposed_issubset(self, info);
406: }
407:
408: public PyObject __call__(PyObject arg0) {
409: return ((PyImmutableSet) self).baseset_issubset(arg0);
410: }
411:
412: }
413: dict.__setitem__("issubset", new PyMethodDescr("issubset",
414: PyImmutableSet.class, 1, 1, new exposed_issubset(null,
415: null)));
416: class exposed_issuper set extends PyBuiltinMethodNarrow {
417:
418: exposed_issuper set(PyObject self,
419: PyBuiltinFunction.Info info) {
420: super (self, info);
421: }
422:
423: public PyBuiltinFunction bind(PyObject self) {
424: return new exposed_issuperset(self, info);
425: }
426:
427: public PyObject __call__(PyObject arg0) {
428: return ((PyImmutableSet) self).baseset_issuper set(arg0);
429: }
430:
431: }
432: dict.__setitem__("issuperset", new PyMethodDescr("issuperset",
433: PyImmutableSet.class, 1, 1, new exposed_issuperset(
434: null, null)));
435: class exposed___len__ extends PyBuiltinMethodNarrow {
436:
437: exposed___len__(PyObject self, PyBuiltinFunction.Info info) {
438: super (self, info);
439: }
440:
441: public PyBuiltinFunction bind(PyObject self) {
442: return new exposed___len__(self, info);
443: }
444:
445: public PyObject __call__() {
446: return Py.newInteger(((PyImmutableSet) self)
447: .baseset___len__());
448: }
449:
450: }
451: dict.__setitem__("__len__", new PyMethodDescr("__len__",
452: PyImmutableSet.class, 0, 0, new exposed___len__(null,
453: null)));
454: class exposed___reduce__ extends PyBuiltinMethodNarrow {
455:
456: exposed___reduce__(PyObject self,
457: PyBuiltinFunction.Info info) {
458: super (self, info);
459: }
460:
461: public PyBuiltinFunction bind(PyObject self) {
462: return new exposed___reduce__(self, info);
463: }
464:
465: public PyObject __call__() {
466: return ((PyImmutableSet) self).baseset___reduce__();
467: }
468:
469: }
470: dict.__setitem__("__reduce__", new PyMethodDescr("__reduce__",
471: PyImmutableSet.class, 0, 0, new exposed___reduce__(
472: null, null)));
473: class exposed___hash__ extends PyBuiltinMethodNarrow {
474:
475: exposed___hash__(PyObject self, PyBuiltinFunction.Info info) {
476: super (self, info);
477: }
478:
479: public PyBuiltinFunction bind(PyObject self) {
480: return new exposed___hash__(self, info);
481: }
482:
483: public PyObject __call__() {
484: return Py.newInteger(((PyImmutableSet) self)
485: .ImmutableSet_hashCode());
486: }
487:
488: }
489: dict.__setitem__("__hash__", new PyMethodDescr("__hash__",
490: PyImmutableSet.class, 0, 0, new exposed___hash__(null,
491: null)));
492: class exposed___repr__ extends PyBuiltinMethodNarrow {
493:
494: exposed___repr__(PyObject self, PyBuiltinFunction.Info info) {
495: super (self, info);
496: }
497:
498: public PyBuiltinFunction bind(PyObject self) {
499: return new exposed___repr__(self, info);
500: }
501:
502: public PyObject __call__() {
503: return new PyString(((PyImmutableSet) self)
504: .baseset_toString());
505: }
506:
507: }
508: dict.__setitem__("__repr__", new PyMethodDescr("__repr__",
509: PyImmutableSet.class, 0, 0, new exposed___repr__(null,
510: null)));
511: class exposed___init__ extends PyBuiltinMethod {
512:
513: exposed___init__(PyObject self, PyBuiltinFunction.Info info) {
514: super (self, info);
515: }
516:
517: public PyBuiltinFunction bind(PyObject self) {
518: return new exposed___init__(self, info);
519: }
520:
521: public PyObject __call__(PyObject[] args) {
522: return __call__(args, Py.NoKeywords);
523: }
524:
525: public PyObject __call__(PyObject[] args, String[] keywords) {
526: ((PyImmutableSet) self).ImmutableSet_init(args,
527: keywords);
528: return Py.None;
529: }
530:
531: }
532: dict.__setitem__("__init__", new PyMethodDescr("__init__",
533: PyImmutableSet.class, -1, -1, new exposed___init__(
534: null, null)));
535: dict.__setitem__("__new__", new PyNewWrapper(
536: PyImmutableSet.class, "__new__", -1, -1) {
537:
538: public PyObject new_impl(boolean init, PyType subtype,
539: PyObject[] args, String[] keywords) {
540: PyImmutableSet newobj;
541: if (for_type == subtype) {
542: newobj = new PyImmutableSet();
543: if (init)
544: newobj.ImmutableSet_init(args, keywords);
545: } else {
546: newobj = new PyImmutableSetDerived(subtype);
547: }
548: return newobj;
549: }
550:
551: });
552: }
553:
554: //~ END GENERATED REGION -- DO NOT EDIT SEE gexpose.py
555:
556: public PyImmutableSet() {
557: super ();
558: }
559:
560: public PyImmutableSet(PyType type) {
561: super (type);
562: }
563:
564: public PyImmutableSet(PyObject data) {
565: super (data);
566: }
567:
568: final void ImmutableSet_init(PyObject[] args, String[] kwds) {
569: int nargs = args.length - kwds.length;
570: if (nargs > 1) {
571: throw PyBuiltinFunction.DefaultInfo.unexpectedCall(nargs,
572: false, exposed_name, 0, 1);
573: }
574: if (nargs == 0) {
575: return;
576: }
577:
578: PyObject o = args[0];
579: _update(o);
580: }
581:
582: final int ImmutableSet_hashCode() {
583: return hashCode();
584: }
585:
586: public int hashCode() {
587: return this ._set.hashCode();
588: }
589:
590: public PyObject _as_immutable() {
591: return this ;
592: }
593:
594: // public void clear() {
595: // throw new UnsupportedOperationException();
596: // }
597: //
598: // public boolean add(Object o) {
599: // throw new UnsupportedOperationException();
600: // }
601: //
602: // public boolean remove(Object o) {
603: // throw new UnsupportedOperationException();
604: // }
605: //
606: // public boolean addAll(Collection c) {
607: // throw new UnsupportedOperationException();
608: // }
609: //
610: // public boolean removeAll(Collection c) {
611: // throw new UnsupportedOperationException();
612: // }
613: //
614: // public boolean retainAll(Collection c) {
615: // throw new UnsupportedOperationException();
616: // }
617: }
|