|
32 | 32 | "String", |
33 | 33 | "StringBuffer", |
34 | 34 | "StringBuilder", |
| 35 | + "System", |
35 | 36 | "Thread", |
36 | 37 | "Throwable", |
37 | 38 | "UnsupportedOperationException", |
|
40 | 41 |
|
41 | 42 | import __builtin__ as builtins |
42 | 43 | import array |
| 44 | +import os |
43 | 45 | import time |
44 | 46 | from typing import TYPE_CHECKING, Any, List, Optional, Set, Union |
45 | 47 |
|
46 | 48 | from java.lang.reflect import AccessFlag, Type |
47 | 49 |
|
48 | 50 | if TYPE_CHECKING: |
| 51 | + from java.io import InputStream, PrintStream |
49 | 52 | from java.nio import CharBuffer |
| 53 | + from java.nio.channels import Channel |
50 | 54 | from java.time import Duration |
51 | | - from java.util import Iterator, Spliterator |
| 55 | + from java.util import Iterator, Properties, Spliterator |
52 | 56 | from java.util.concurrent import ThreadFactory |
53 | 57 | from java.util.function import Consumer, Supplier |
54 | 58 | from java.util.stream import IntStream, Stream |
@@ -714,6 +718,153 @@ def trimToSize(self): |
714 | 718 | pass |
715 | 719 |
|
716 | 720 |
|
| 721 | +class System(Object): |
| 722 | + """The System class contains several useful class fields and |
| 723 | + methods. |
| 724 | +
|
| 725 | + It cannot be instantiated. Among the facilities provided by the |
| 726 | + System class are standard input, standard output, and error output |
| 727 | + streams; access to externally defined properties and environment |
| 728 | + variables; a means of loading files and libraries; and a utility |
| 729 | + method for quickly copying a portion of an array. |
| 730 | + """ |
| 731 | + |
| 732 | + err = None # type: PrintStream |
| 733 | + in_ = None # type: InputStream |
| 734 | + out = None # type: PrintStream |
| 735 | + |
| 736 | + @staticmethod |
| 737 | + def arraycopy(src, srcPos, dest, destPos, length): |
| 738 | + # type: (Any, int, Any, int, int) -> None |
| 739 | + dest[destPos : destPos + length] = src[srcPos : srcPos + length] |
| 740 | + |
| 741 | + @staticmethod |
| 742 | + def clearProperty(key): |
| 743 | + # type: (Union[str, unicode]) -> Union[str, unicode] |
| 744 | + pass |
| 745 | + |
| 746 | + @staticmethod |
| 747 | + def console(): |
| 748 | + # type: () -> Any |
| 749 | + pass |
| 750 | + |
| 751 | + @staticmethod |
| 752 | + def currentTimeMillis(): |
| 753 | + # type: () -> long |
| 754 | + return long(time.time() * 1000) |
| 755 | + |
| 756 | + @staticmethod |
| 757 | + def exit(status): |
| 758 | + # type: (int) -> None |
| 759 | + pass |
| 760 | + |
| 761 | + @staticmethod |
| 762 | + def gc(): |
| 763 | + # type: () -> None |
| 764 | + pass |
| 765 | + |
| 766 | + @staticmethod |
| 767 | + def getenv(name=None): |
| 768 | + # type: (Optional[Union[str, unicode]]) -> Any |
| 769 | + return dict(os.environ) if name is None else os.environ.get(str(name)) |
| 770 | + |
| 771 | + @staticmethod |
| 772 | + def getLogger(name, bundle=None): |
| 773 | + # type: (Union[str, unicode], Optional[Any]) -> Any |
| 774 | + pass |
| 775 | + |
| 776 | + @staticmethod |
| 777 | + def getProperties(): |
| 778 | + # type: () -> Properties |
| 779 | + pass |
| 780 | + |
| 781 | + @staticmethod |
| 782 | + def getProperty( |
| 783 | + key, # type: Union[str, unicode] |
| 784 | + def_=None, # type: Optional[Union[str, unicode]] |
| 785 | + ): |
| 786 | + # type: (...) -> Union[str, unicode] |
| 787 | + pass |
| 788 | + |
| 789 | + @staticmethod |
| 790 | + def getSecurityManager(): |
| 791 | + # type: () -> Any |
| 792 | + pass |
| 793 | + |
| 794 | + @staticmethod |
| 795 | + def identityHashCode(x): |
| 796 | + # type: (Object) -> int |
| 797 | + return id(x) |
| 798 | + |
| 799 | + @staticmethod |
| 800 | + def inheritedChannel(): |
| 801 | + # type: () -> Channel |
| 802 | + pass |
| 803 | + |
| 804 | + @staticmethod |
| 805 | + def lineSeparator(): |
| 806 | + # type: () -> Union[str, unicode] |
| 807 | + return os.linesep |
| 808 | + |
| 809 | + @staticmethod |
| 810 | + def load(filename): |
| 811 | + # type: (Union[str, unicode]) -> None |
| 812 | + pass |
| 813 | + |
| 814 | + @staticmethod |
| 815 | + def loadLibrary(libname): |
| 816 | + # type: (Union[str, unicode]) -> None |
| 817 | + pass |
| 818 | + |
| 819 | + @staticmethod |
| 820 | + def mapLibraryName(libname): |
| 821 | + # type: (Union[str, unicode]) -> Union[str, unicode] |
| 822 | + pass |
| 823 | + |
| 824 | + @staticmethod |
| 825 | + def nanoTime(): |
| 826 | + # type: () -> long |
| 827 | + return long(time.time() * 1000000000) |
| 828 | + |
| 829 | + @staticmethod |
| 830 | + def runFinalization(): |
| 831 | + # type: () -> None |
| 832 | + pass |
| 833 | + |
| 834 | + @staticmethod |
| 835 | + def setErr(err): |
| 836 | + # type: (PrintStream) -> None |
| 837 | + pass |
| 838 | + |
| 839 | + @staticmethod |
| 840 | + def setIn(in_): |
| 841 | + # type: (InputStream) -> None |
| 842 | + pass |
| 843 | + |
| 844 | + @staticmethod |
| 845 | + def setOut(out): |
| 846 | + # type: (PrintStream) -> None |
| 847 | + pass |
| 848 | + |
| 849 | + @staticmethod |
| 850 | + def setProperties(props): |
| 851 | + # type: (Properties) -> None |
| 852 | + pass |
| 853 | + |
| 854 | + @staticmethod |
| 855 | + def setProperty( |
| 856 | + key, # type: Union[str, unicode] |
| 857 | + value, # type: Union[str, unicode] |
| 858 | + ): |
| 859 | + # type: (...) -> Union[str, unicode] |
| 860 | + pass |
| 861 | + |
| 862 | + @staticmethod |
| 863 | + def setSecurityManager(sm): |
| 864 | + # type: (Any) -> None |
| 865 | + pass |
| 866 | + |
| 867 | + |
717 | 868 | class Throwable(Object, builtins.Exception): |
718 | 869 | """The Throwable class is the superclass of all errors and |
719 | 870 | exceptions in the Java language. |
|
0 commit comments