Java Recursive End __java

Source: Internet
Author: User

Demand:
Want to update the UI interface after recursion ends. When is the end of recursion? Someone on the internet to judge a fixed parameter, and then end, simply inexplicable, this fixed parameter is random random, unscientific.
Ideas:
The value of size is collected according to the judgement I=0. By i=0, the length of the loop is collected, because each loop has a i=0, and there is only one, which collects the total length of the cycle according to Num.
Code:

for (int i = 0; I < ((List) data). Size (); i++) {
            num++;
            if (i = = 0) {
                log.e (Constants.log_tag, "size:" + addnum (((List) data). Size ());
            }
            LOG.E (Constants.log_tag, "+ +" + num + "; Size ():" + ((List) data). Size ()); · •
        }
        LOG.E (Constants.log_tag, "; Num:" + num);
        if (num = = size) {
        ///recursive end will execute
        the

     private int addnum (int num) {
        log.e (Constants.log_tag, "addnum:" + si Ze);
        size = size + num;
        return size;
    }

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.