Artificial Intelligence programming

BlvdBrawler

Superstar
Joined
May 1, 2012
Messages
12,715
Reputation
469
Daps
19,546
Reppin
NULL
rampage_stare.gif


god bless algorithms. At least the ones that are already written :lolbron:

the Collections class :blessed:

:ahh:
 

Silver Surfer

Veteran
Joined
May 1, 2012
Messages
36,981
Reputation
-4,863
Daps
83,393
my nikka. what the fukk is that? can't tell where the parameters begin and end.

Bruh Im about to give you some back ground.....we got this table we filling up with getters......thats all good...but I got to this page where some of the getters are "derived"...meaning they are built off other getters...not from the database.....


like so:

funding bean has this:

public BigDecimal getRomTotalCost()
{
return MgmtviewBO.assumeNullBigDecimalAdd(plannedLabor, plannedMaterial);
}

This just adds to getters together and returns that to getRomTotalCost()

Here is the problem...I need to loop through all the beans in a list and make a "total" row...thats easy using JSTL...but I have to dothis with backend J2EE

So what I had to do was create a "setter" that took those 2 parmeters:

public void setRomTotalCost(BigDecimal plannedLabor, BigDecimal plannedMaterial)
{
this.plannedLabor = plannedLabor;
this.plannedMaterial = plannedMaterial;
}



now in the action page...I loop through...and call that "getter" and add it to itself with this method MgmtviewBO.totalsBigDecimalAdd() and store it in the setter

voila!!!!

// Create totals bean.
for (FundingMwslinBean bean : beans)
{
totals.setRomTotalCost(MgmtviewBO.totalsBigDecimalAdd(totals.getPlannedLabor(), bean.getPlannedLabor()), MgmtviewBO.totalsBigDecimalAdd(totals.getPlannedMaterial(), bean.getPlannedMaterial()));

}
beans.add(totals);


If you look closely to can see that setRomTotalCost above is taking 2 parameters.....


its alot more involved..im just trying to type the general idea....
 

semtex

:)
Joined
May 1, 2012
Messages
20,310
Reputation
3,396
Daps
46,188
My programming skills could always use improvement. I'm trying to really boss up at it.
 
Top