请教彭老师关于遍历的问题

04-09-18 wueg2003
在jive中

public DatabaseObjectIterator(int type, long [] elements,

final Object extraObject)

{

this.elements = elements;

// Load the appropriate proxy factory depending on the type of object

// that we're iterating through.

switch (type) {

// FORUM

case JiveGlobals.FORUM:

// Create an objectFactory to load forums.

this.objectFactory = new DatabaseObjectFactory() {

ForumFactory factory = (ForumFactory)extraObject;

public Object loadObject(long id) {

try {

Forum forum = factory.getForum(id);

return forum;

}

catch (ForumNotFoundException mnfe) { }

catch (UnauthorizedException ue) { }

return null;

}

};

break;

//THREAD

case JiveGlobals.THREAD:

。。。。。。。

中id是怎么处理的呀,还有DatabaseObjectFactory接口怎么会能new 呢

和public Object loadObject(long id)中的id是怎么取得,谢谢!!

banq
2004-09-22 08:50
这个问题好像以前有人问过,这是一个内部类的写法,其实就是类中有类。

猜你喜欢