Make lists work like Python list containers.

This commit is contained in:
Benson Margulies 2015-04-30 16:24:27 -04:00
parent 0c86904ede
commit 2753c59573
1 changed files with 6 additions and 0 deletions

View File

@ -215,6 +215,12 @@ def autoclass(clsname):
classDict[name] = JavaMultipleMethod(signatures)
for iclass in c.getInterfaces():
if iclass.getName() == 'java.util.List':
classDict['__getitem__'] = lambda self, index: self.get(index)
classDict['__len__'] = lambda self: self.size()
break
for field in c.getFields():
static = Modifier.isStatic(field.getModifiers())
sig = get_signature(field.getType())