From 5e336544f5c8c7fac40c5d9596ed6b1373d5585b Mon Sep 17 00:00:00 2001 From: Joel Dice Date: Sun, 29 Jul 2007 17:38:35 -0600 Subject: [PATCH] classpath progress --- classpath/java/io/PrintStream.java | 16 ++++++++++++++++ classpath/java/io/PrintWriter.java | 16 ++++++++++++++++ classpath/java/lang/Math.java | 12 ++++++++++++ 3 files changed, 44 insertions(+) diff --git a/classpath/java/io/PrintStream.java b/classpath/java/io/PrintStream.java index 1aae640d5a..a63455af01 100644 --- a/classpath/java/io/PrintStream.java +++ b/classpath/java/io/PrintStream.java @@ -22,6 +22,14 @@ public class PrintStream extends OutputStream { } catch (IOException e) { } } + public void print(Object o) { + print(o.toString()); + } + + public void print(char c) { + print(String.valueOf(c)); + } + public synchronized void println(String s) { try { out.write(s.getBytes()); @@ -36,6 +44,14 @@ public class PrintStream extends OutputStream { if (autoFlush) flush(); } catch (IOException e) { } } + + public void println(Object o) { + println(o.toString()); + } + + public void println(char c) { + println(String.valueOf(c)); + } public void write(int c) throws IOException { out.write(c); diff --git a/classpath/java/io/PrintWriter.java b/classpath/java/io/PrintWriter.java index 889fbca18c..6ed4e02da4 100644 --- a/classpath/java/io/PrintWriter.java +++ b/classpath/java/io/PrintWriter.java @@ -30,6 +30,14 @@ public class PrintWriter extends Writer { } catch (IOException e) { } } + public void print(Object o) { + print(o.toString()); + } + + public void print(char c) { + print(String.valueOf(c)); + } + public synchronized void println(String s) { try { out.write(s.toCharArray()); @@ -45,6 +53,14 @@ public class PrintWriter extends Writer { } catch (IOException e) { } } + public void println(Object o) { + println(o.toString()); + } + + public void println(char c) { + println(String.valueOf(c)); + } + public void write(char[] buffer, int offset, int length) throws IOException { out.write(buffer, offset, length); if (autoFlush) flush(); diff --git a/classpath/java/lang/Math.java b/classpath/java/lang/Math.java index 4705846337..186b8c755e 100644 --- a/classpath/java/lang/Math.java +++ b/classpath/java/lang/Math.java @@ -7,6 +7,18 @@ public final class Math { return (v < 0 ? -v : v); } + public static long abs(long v) { + return (v < 0 ? -v : v); + } + + public static float abs(float v) { + return (v < 0 ? -v : v); + } + + public static double abs(double v) { + return (v < 0 ? -v : v); + } + public static long round(double v) { return (long) (v + 0.5); }