Skip to content

Commit

Permalink
feat: add Iterable Java interface
Browse files Browse the repository at this point in the history
  • Loading branch information
cesarcoatl committed Oct 20, 2021
1 parent 894b055 commit c23a469
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/java/lang/__init__.py
Expand Up @@ -7,6 +7,7 @@
__all__ = [
"Exception",
"IllegalArgumentException",
"Iterable",
"Object",
"RuntimeException",
"Thread",
Expand All @@ -22,6 +23,25 @@
import builtins


class Iterable(object):
"""Implementing this interface allows an object to be the target of
the enhanced for statement (sometimes called the "for-each loop"
statement).
"""

def __iter__(self):
pass

def forEach(self, action):
pass

def iterator(self):
raise NotImplementedError

def spliterator(self):
pass


class Object(object):
"""Class Object is the root of the class hierarchy. Every class has
Object as a superclass. All objects, including arrays, implement the
Expand Down

0 comments on commit c23a469

Please sign in to comment.