test

02-09-18 banq

    public ForumThreadIterator threads(ResultFilter resultFilter) {
	//根据传入的resultFilter构造一个查询SQL语句(*注1)
        String query = getThreadListSQL(resultFilter, false);
	//返回一个确定返回的id列表,这里缺省大小是400个,例如,我要看1~15条纪录
	// threadBlock的length是400,从1~400(*注2)
        long [] threadBlock = getBlock(query.toString(), resultFilter.getStartIndex());
        int startIndex = resultFilter.getStartIndex();
        int endIndex;
        // If number of results is set to inifinite, set endIndex to the total
        // number of threads in the forum.
        if (resultFilter.getNumResults() == ResultFilter.NULL_INT) {
            endIndex = (int)getThreadCount(resultFilter);
        }
        else {
            endIndex = resultFilter.getNumResults() + startIndex;
        }
	//嘿嘿,理解了上面几句代码先,然后来看这个iterator
        return new ForumThreadBlockIterator(threadBlock, query.toString(),
                startIndex, endIndex, this.id, factory);
    }


<p>

banq
2002-09-18 16:37

test

banq
2002-09-18 16:38

    public ForumThreadIterator threads(ResultFilter resultFilter) {
	//根据传入的resultFilter构造一个查询SQL语句(*注1)
        String query = getThreadListSQL(resultFilter, false);
	//返回一个确定返回的id列表,这里缺省大小是400个,例如,我要看1~15条纪录
	// threadBlock的length是400,从1~400(*注2)
        long [] threadBlock = getBlock(query.toString(), resultFilter.getStartIndex());
        int startIndex = resultFilter.getStartIndex();
        int endIndex;
        // If number of results is set to inifinite, set endIndex to the total
        // number of threads in the forum.
        if (resultFilter.getNumResults() == ResultFilter.NULL_INT) {
            endIndex = (int)getThreadCount(resultFilter);
        }
        else {
            endIndex = resultFilter.getNumResults() + startIndex;
        }
	//嘿嘿,理解了上面几句代码先,然后来看这个iterator
        return new ForumThreadBlockIterator(threadBlock, query.toString(),
                startIndex, endIndex, this.id, factory);
    

asasdasdasdwqewqeqweqwe

浆糊
2002-11-08 09:26

test