站内搜索: 请输入搜索关键词
当前页面: 图书首页 > Programming Wireless Devices with the Java2 Platform

Programming Wireless Devices with the Java2 Platform

[ directory ] Previous Section Next Section

5.4 New for CLDC 1.1

graphics/new_icon.gif

The following list summarizes the Java library changes between CLDC Specification versions 1.0 and 1.1. For details, refer to "CLDC Almanac" on page 359.

  • Classes Float and Double have been added.

  • The following methods have been added to other library classes to handle floating point values:

    • java.lang.Integer.doubleValue()

    • java.lang.Integer.floatValue()

    • java.lang.Long.doubleValue()

    • java.lang.Long.floatValue()

    • java.lang.Math.abs(double a)

    • java.lang.Math.abs(float a)

    • java.lang.Math.max(double a, double b)

    • java.lang.Math.max(float a, float b)

    • java.lang.Math.min(double a, double b)

    • java.lang.Math.min(float a, float b)

    • java.lang.Math.ceil(double a)

    • java.lang.Math.floor(double a)

    • java.lang.Math.sin(double a)

    • java.lang.Math.cos(double a)

    • java.lang.Math.tan(double a)

    • java.lang.Math.sqrt(double a)

    • java.lang.Math.toDegrees(double angrad)

    • java.lang.Math.toRadians(double angrad)

    • java.lang.String.valueOf(double d)

    • java.lang.String.valueOf(float f)

    • java.lang.StringBuffer.append(double d)

    • java.lang.StringBuffer.append(float f)

    • java.lang.StringBuffer.insert(int offset, double d)

    • java.lang.StringBuffer.insert(int offset, float f)

    • java.io.DataInput.readDouble()

    • java.io.DataInput.readFloat()

    • java.io.DataInputStream.readDouble()

    • java.io.DataInputStream.readFloat()

    • java.io.DataOutput.writeDouble(double v)

    • java.io.DataOutput.writeFloat(float v)

    • java.io.DataOutputStream.writeDouble(double v)

    • java.io.DataOutputStream.writeFloat(float f)

    • java.io.PrintStream.print(double d)

    • java.io.PrintStream.print(float f)

    • java.io.PrintStream.println(double d)

    • java.io.PrintStream.println(float f)

    • java.util.Random.nextDouble()

    • java.util.Random.nextFloat()

  • The following fields have been added to support floating point calculations:

    • java.lang.Math.E

    • java.lang.Math.PI

  • Classes java.lang.ref.Reference and java.lang.ref.WeakReference have been added.

  • Classes java.util.Calendar, java.util.Date and java.util.TimeZone have been redesigned to be more J2SE-compliant by adding a number of fields and methods.

  • One new error class, NoClassDefFoundError, has been added.

  • Class Thread has the following new methods and constructors:

    • Thread.getName()

    • Thread.interrupt()

    • Thread(Runnable Target, String name)

    • Thread(String name)

  • In addition, the following fields and methods have been added:

    • java.lang.Boolean.TRUE and java.lang.Boolean.FALSE

    • java.lang.String.intern()

    • java.lang.String.equalsIgnoreCase()

    • java.util.Date.toString()

    • java.util.Random.nextInt(int n)

    [ directory ] Previous Section Next Section