Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion Chaining Methods and Performance.

Received: by 10.91.62.15 with SMTP id p15mr315376agk.19.1300221536240;
        Tue, 15 Mar 2011 13:38:56 -0700 (PDT)
X-BeenThere: android-developers@googlegroups.com
Received: by 10.91.202.30 with SMTP id e30ls2201agq.1.p; Tue, 15 Mar 2011
 13:37:41 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.90.18.39 with SMTP id 39mr2357agr.32.1300221461439; Tue, 15
 Mar 2011 13:37:41 -0700 (PDT)
Received: by q40g2000prh.googlegroups.com with HTTP; Tue, 15 Mar 2011 13:37:41
 -0700 (PDT)
Date: Tue, 15 Mar 2011 13:37:41 -0700 (PDT)
X-IP: 75.35.75.86
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US;
 rv:1.9.2.13) Gecko/20101203 Firefox/3.6.13 FirePHP/0.5,gzip(gfe)
Message-ID: <575c7981-a88a-4692-8d86-a6c5ac552ee9@q40g2000prh.googlegroups.com>
Subject: Chaining Methods and Performance.
From: brookisme <br...@stickandlogdesigns.com>
To: Android Developers <android-developers@googlegroups.com>
Content-Type: text/plain; charset=ISO-8859-1

Hi Guys.  When creating methods in my custom classes I like to use the
old trick of returning "this" on a lot of methods so that I can chain
methods together like so

MyCustomClass mcc = new MyCustomClass();

mcc.method1().method2().method3();


I was wondering if i were to do this with my "setters"  (so my setters
had the return type MyCostumClass  instead of void) will that hurt
preformance?

I guess the problem is I don't have a good understanding for what
happens to unused return values.

Thanks