如果不严格的说,cldc的类库是j2se的一个小的子集,有以下这种近似关系成立,即j2se包含cdc包含cldc。但要注意cldc并未完全包含于j2se,它还包括一些专门针对无线设施的类。所以可以把cldc的类库简要划分为两部分:从j2se继承的类和cldc专有的类。
1. 从j2se继承的类
这部分包括三个package,即java.lang,java.util和java.io。注意即使这些从j2se继承的的类,也是大大“缩了水”的。例如java.util的类与接口由j2se的47个缩减到10个。另外两个也有相应缩减。
系统类
from java.lang:
object, class, runtime, system, thread, runnable,
string, stringbuffer, throwable
数据类型类
from java.lang:
boolean, byte, short, integer, long, character
容器类(container class)
from java.util:
vector, stack, hashtable, enumeration
i/o 类
from java.i
inputstream, outputstream, bytearrayinputstream,
bytearrayoutputstream, datainput, dataoutput,
datainputstream, dataoutputstream, reader, writer,
inputstreamreader, outputstreamwriter, printstream
日期与时间类
from java.util:
calendar, date, timezone
附加的实用类
java.util.random, java.lang.math
异常类(exception classes)
from java.lang:
exception, classnotfoundexception,
illegalaccessexception, instantiationexception,
interruptedexception, runtimeexception,
arithmeticexception, arraystoreexception,
classcastexception, illegalargumentexception,
illegalthreadstateexception, numberformatexception,
illegalmonitorstateexception, indexoutofboundsexception,
arrayindexoutofboundsexception,
stringindexoutofboundsexception,
negativearraysizeexception, nullpointerexception,
securityexception
from java.util:
emptystackexception, nosuchelementexception
from java.i
eofexception, ioexception, interruptedexception,
unsupportedencodingexception, utfdataformatexception
错误类
from java.lang:
error, virtualmachineerror, outofmemoryerror
2. cldc专有的类
这里sun提供了javax.microedition.io包。用它来提供与外界沟通的桥梁。(注:就像在j2se中我们利用java.net.*)注意,所有的连接都由javax.microedition.connector创建。例如:
你可以打开一个http连接通过connector.open("http://www.chinajavaworld.com")
javax.microedition.io的接口包括:
connection, inputconnection, outputconnection,
streamconnection, contentconnection, datagramconnection,
streamconnectionnotifier
这里再说明一点,实际上你也可以看出,cldc所包括的类库,并不足以开发应用程序。例如,没有ui界面的支持等。这也正是cldc的设计理念。cldc本身就从未想过要解决所有的问题。这些问题要靠其上层的profile-midp来解决。例如javax.microedition.lcdui就是定义在midp中的ui包。
Java Asp PHP .Net XML C/C++ CGI VB Jsp J2ee J2se J2me EJB Servlet Tomcat Resin Struts Weblogic Eclipse ANT GUI JMS Web servise IDEA Webphere Hibernate Spring Jboss Applet Swing Socket Javamail Perl Ajax P2P 安全 模式 框架 测试 开源 游戏
Windows XP Windows 2000 Windows 2003 Windows Me Windows 9.x Linux UNIX 注册表 操作系统 服务器 应用服务器