forked from thoka/java2python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathutil.py
More file actions
35 lines (23 loc) · 660 Bytes
/
Copy pathutil.py
File metadata and controls
35 lines (23 loc) · 660 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
from objects import Iterator, Object
from helpers import str
class Collection(list):
def add(self,o):
self.append(o)
def iterator(self):
return Iterator(self)
def __str__(self):
return "[%s]" % (', '.join([str(i) for i in self]))
class List(Collection):
pass
class ArrayList(Collection):
def __init__(self,typ = (Object,)):
self._typ = typ
class Arrays(object):
@classmethod
def asList(self,*a):
res = List()
res.extend(a)
return res
class HashMap(Object):
# TODO
pass