<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://mediawiki.zeropage.org/index.php?action=history&amp;feed=atom&amp;title=Refactoring%2FMakingMethodCallsSimpler</id>
	<title>Refactoring/MakingMethodCallsSimpler - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://mediawiki.zeropage.org/index.php?action=history&amp;feed=atom&amp;title=Refactoring%2FMakingMethodCallsSimpler"/>
	<link rel="alternate" type="text/html" href="https://mediawiki.zeropage.org/index.php?title=Refactoring/MakingMethodCallsSimpler&amp;action=history"/>
	<updated>2026-05-16T00:32:28Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.39.8</generator>
	<entry>
		<id>https://mediawiki.zeropage.org/index.php?title=Refactoring/MakingMethodCallsSimpler&amp;diff=84888&amp;oldid=prev</id>
		<title>Maintenance script: Repair batch-0003 pages from live compare</title>
		<link rel="alternate" type="text/html" href="https://mediawiki.zeropage.org/index.php?title=Refactoring/MakingMethodCallsSimpler&amp;diff=84888&amp;oldid=prev"/>
		<updated>2026-03-27T00:29:07Z</updated>

		<summary type="html">&lt;p&gt;Repair batch-0003 pages from live compare&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 00:29, 27 March 2026&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l125&quot;&gt;Line 125:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 125:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  double getValueForPeriod (int periodNumber) {&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  double getValueForPeriod (int periodNumber) {&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  	try {&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  	try {&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  		return _values&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[&lt;/del&gt;periodNumber&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;]&lt;/del&gt;;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  		return _values&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;amp;#91;&lt;/ins&gt;periodNumber&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;amp;#93;&lt;/ins&gt;;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  	} catch (ArrayIndexOutOfBoundsException e) {&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  	} catch (ArrayIndexOutOfBoundsException e) {&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  		return 0;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  		return 0;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l133&quot;&gt;Line 133:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 133:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  double getValueForPeriod (int periodNumber) {&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  double getValueForPeriod (int periodNumber) {&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  	if (periodNumber &amp;amp;gt;= _values.length) return 0;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  	if (periodNumber &amp;amp;gt;= _values.length) return 0;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  	return _values&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[&lt;/del&gt;periodNumber&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;]&lt;/del&gt;;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  	return _values&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;amp;#91;&lt;/ins&gt;periodNumber&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;amp;#93;&lt;/ins&gt;;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  }&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  }&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;----&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;----&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[&lt;/del&gt;Refactoring&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;]]&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Refactoring&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt; &lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key mediawiki:diff::1.12:old-38385:rev-84888 --&gt;
&lt;/table&gt;</summary>
		<author><name>Maintenance script</name></author>
	</entry>
	<entry>
		<id>https://mediawiki.zeropage.org/index.php?title=Refactoring/MakingMethodCallsSimpler&amp;diff=38385&amp;oldid=prev</id>
		<title>imported&gt;Unknown at 05:27, 7 February 2021</title>
		<link rel="alternate" type="text/html" href="https://mediawiki.zeropage.org/index.php?title=Refactoring/MakingMethodCallsSimpler&amp;diff=38385&amp;oldid=prev"/>
		<updated>2021-02-07T05:27:53Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;__TOC__&lt;br /&gt;
= Chapter 10 Making Method Calls Simpler =&lt;br /&gt;
== Rename Method ==&lt;br /&gt;
The name of a method does not reveal its purpose. &lt;br /&gt;
 &amp;#039;&amp;#039;Change the name of the method&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
http://zeropage.org/~reset/zb/data/RenameMethod.gif&lt;br /&gt;
&lt;br /&gt;
== Add Parameter ==&lt;br /&gt;
A method needs more information from its caller.&lt;br /&gt;
 &amp;#039;&amp;#039;Add a parameter for an object that can pass on this information&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
http://zeropage.org/~reset/zb/data/AddParameter.gif&lt;br /&gt;
== Remove Parameter ==&lt;br /&gt;
A parameter is no longer used by the method body.&lt;br /&gt;
 &amp;#039;&amp;#039;Remove it&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
http://zeropage.org/~reset/zb/data/RemoveParameter.gif&lt;br /&gt;
== Separate Query from Modifier ==&lt;br /&gt;
You have a method that returns a value but also changes the state of an object.&lt;br /&gt;
 &amp;#039;&amp;#039;Create two methods, one for the query and one for the modification&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
http://zeropage.org/~reset/zb/data/SeparateQueryFromModifier.gif&lt;br /&gt;
== Parameterize Method ==&lt;br /&gt;
Several methods do similar things but with different values contained in the method body.&lt;br /&gt;
 &amp;#039;&amp;#039;Create one method that uses a parameter for the different values&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
http://zeropage.org/~reset/zb/data/ParameterizeMethod.gif&lt;br /&gt;
== Replace Paramter with Explicit Method ==&lt;br /&gt;
You have a method that runs different code depending on the values of an enumerated parameter.&lt;br /&gt;
 &amp;#039;&amp;#039;Create a separate method for each value of the parameter&amp;#039;&amp;#039;&lt;br /&gt;
 void setValue (String name, int value) {&lt;br /&gt;
 	if (name.equals(&amp;quot;height&amp;quot;))&lt;br /&gt;
 		_height = value;&lt;br /&gt;
 	if (name.equals(&amp;quot;width&amp;quot;))&lt;br /&gt;
 		_width = value;&lt;br /&gt;
 	Assert.shouldNeverReachHere();&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
 void setHeight (int arg) {&lt;br /&gt;
 	_height = arg;&lt;br /&gt;
 }&lt;br /&gt;
 void setWidth (int arg) {&lt;br /&gt;
 	_width = arg;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
== Preserve Whole Object ==&lt;br /&gt;
You are getting several values from an object and passing these values as parameters in a method call.&lt;br /&gt;
 &amp;#039;&amp;#039;Send the whole object instead&amp;#039;&amp;#039;&lt;br /&gt;
 int low = daysTempRange().getLow();&lt;br /&gt;
 int high = days.TempRange().getHight();&lt;br /&gt;
 withinPlan = plan.withinRange (low, high);&lt;br /&gt;
&lt;br /&gt;
 withinPlan = plan.withinRange (daysTempRange());&lt;br /&gt;
&lt;br /&gt;
== Replace Parameter with Method ==&lt;br /&gt;
An object invokes a method, then passes the result as a parameter for a method. The receiver can also invoke this method.&lt;br /&gt;
 &amp;#039;&amp;#039;Remove the parameter and let the receiver invoke the method&amp;#039;&amp;#039;&lt;br /&gt;
 int basePrice = _quantity * _itemPrice;&lt;br /&gt;
 discountLevel = getDiscountLevel ();&lt;br /&gt;
 double finalPrice = discountedPrice (basePrice, discountLevel);&lt;br /&gt;
&lt;br /&gt;
 int basePrice = _quantity * _itemPrice;&lt;br /&gt;
 double finalPrice = discountedPrice (basePrice);&lt;br /&gt;
&lt;br /&gt;
== Introduce Parameter Object ==&lt;br /&gt;
You have a group of parameters that naturally go together.&lt;br /&gt;
 &amp;#039;&amp;#039;Replace them with an object&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
http://zeropage.org/~reset/zb/data/IntroduceParameterObject.gif&lt;br /&gt;
== Remove Setting Method ==&lt;br /&gt;
A field should be set at creation time and never altered.&lt;br /&gt;
 &amp;#039;&amp;#039;Remove any setting method for that field&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
http://zeropage.org/~reset/zb/data/RemoveSettingMethod.gif&lt;br /&gt;
== Hide Method ==&lt;br /&gt;
A method is not used by any other class.&lt;br /&gt;
 &amp;#039;&amp;#039;Make the method private&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
http://zeropage.org/~reset/zb/data/HideMethod.gif&lt;br /&gt;
== Replace Constructor with Factory Method ==&lt;br /&gt;
You want to do more that simple construction when you create an object.&lt;br /&gt;
 &amp;#039;&amp;#039;Replace the constructor with a factory method&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
 Emplyee (int type) {&lt;br /&gt;
 	_type = type;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
 static Emplyee create (int type) {&lt;br /&gt;
 	return new Emplyee (type);&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
== Encapsulate Downcast ==&lt;br /&gt;
A method returns an object that needs to be downcasted by its callers.&lt;br /&gt;
 &amp;#039;&amp;#039;Move the downcast to within the method&amp;#039;&amp;#039;&lt;br /&gt;
 Object lastReading () {&lt;br /&gt;
 	return readings.lastElement ();&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
 Reading lastReading () {&lt;br /&gt;
 	return (Reading) readings.lastElement ();&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
== Replace Error Code with Exception ==&lt;br /&gt;
A method returns a special code to indicate an error.&lt;br /&gt;
 &amp;#039;&amp;#039;Throw an exception instead&amp;#039;&amp;#039;&lt;br /&gt;
 int withdraw(int amount) {&lt;br /&gt;
 	if (amount &amp;amp;gt; _balance)&lt;br /&gt;
 		return -1;&lt;br /&gt;
 	else {&lt;br /&gt;
 		_balance -= amount;&lt;br /&gt;
 		return 0;&lt;br /&gt;
 	}&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 void withdraw(int amount) throws BalanceException {&lt;br /&gt;
 	if (amount &amp;amp;gt; _balance) throw new BalanceException ();&lt;br /&gt;
 	_balance -= amount;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
== Replace Exception with Test ==&lt;br /&gt;
You are throwing an exception on a condition the caller could have checked first.&lt;br /&gt;
 &amp;#039;&amp;#039;Change the caller to make the test first&amp;#039;&amp;#039;&lt;br /&gt;
 double getValueForPeriod (int periodNumber) {&lt;br /&gt;
 	try {&lt;br /&gt;
 		return _values[periodNumber];&lt;br /&gt;
 	} catch (ArrayIndexOutOfBoundsException e) {&lt;br /&gt;
 		return 0;&lt;br /&gt;
 	}&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
 double getValueForPeriod (int periodNumber) {&lt;br /&gt;
 	if (periodNumber &amp;amp;gt;= _values.length) return 0;&lt;br /&gt;
 	return _values[periodNumber];&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
[[Refactoring]]&lt;br /&gt;
&lt;/div&gt;</summary>
		<author><name>imported&gt;Unknown</name></author>
	</entry>
</feed>