javaclass

java/text.py

149:cd2ca8849c5a
2005-01-23 Paul Boddie Added a note about the Java API implementation.
     1 #!/usr/bin/env python     2      3 import java.lang     4      5 class FilterOutputStream(java.lang.Object):     6     def __init__(self, out):     7         self.out = out     8     def write(self, value, *args):     9         if args:    10             start, length = args    11             self.out.write(value[start:start+length])    12         else:    13             self.out.write(value)    14     def flush(self):    15         self.out.flush()    16     def close(self):    17         self.out.close()    18     19 class InputStream(java.lang.Object):    20     def read(self, *args):    21         raise NotImplementedError, "read"    22     def skip(self, n):    23         raise NotImplementedError, "skip"    24     def available(self):    25         raise NotImplementedError, "available"    26     def close(self):    27         raise NotImplementedError, "close"    28     def mark(self, readlimit):    29         raise NotImplementedError, "mark"    30     def reset(self):    31         raise NotImplementedError, "reset"    32     def markSupported(self):    33         raise NotImplementedError, "markSupported"    34     35 class MessageFormat(java.lang.Object):    36     def __init__(self, pattern):    37         self.pattern = pattern    38     39     def applyPattern(self, pattern):    40         self.pattern = pattern    41     applyPattern___java__lang__String = applyPattern    42     43     def equals(self, obj):    44         return self == obj    45     equals___java__lang__Object = equals    46     47     def format(self, *args):    48         raise NotImplementedError, "format"    49     format___java__lang__Object_array____java__lang__StringBuffer___java__text__FieldPosition = format    50     format___java__lang__Object___java__lang__StringBuffer___java__text__FieldPosition = format    51     52     def format__static(pattern, arguments):    53         mf = MessageFormat(pattern)    54         # NOTE: To be implemented.    55         return ""    56     format___java__lang__String___java__lang__Object_array_ = staticmethod(format__static)    57     58     def getFormats(self):    59         raise NotImplementedError, "getFormats"    60     getFormats___ = getFormats    61     62     def getLocale(self):    63         raise NotImplementedError, "getLocale"    64     getLocale___ = getLocale    65         66 setattr(MessageFormat, "__init_____java__lang__String", MessageFormat.__init__)    67     68 class OutputStream(java.lang.Object):    69     def write(self, b, *args):    70         raise NotImplementedError, "write"    71     def flush(self):    72         raise NotImplementedError, "flush"    73     def close(self):    74         raise NotImplementedError, "close"    75     76 # vim: tabstop=4 expandtab shiftwidth=4