Jump to content

Recommended Posts

Posted

I got a list of element where i need to add a new element into it and get the value depending upon id values..

 

public Array(
            int Id,
            String text,
            int requestId,
            //int totalNotes,
           )
    {
super();
this.Id = Id;
this.text = text;
this.requestId = requestId;
//this.totalNotes = totalnotes;
}
 
so all these values are set using sql query result but the element which i need to add has seperate query and which runs on the Id element value..
 
so how i can add that new element into the list.
Posted

may be nenu clear gaa cheppaledhu emo.

 

eppudu okka list lo elements vunnayilist<elements>

 

elements{A,B,c,D}

 

so nenu aa list ne iterate chesi A value tesukoni pass to some method and result should eb assign to D in the list

 

so lsit lo element ki value ela assign chestharu

+1

 

Posted

Iteration time lo

 

for( Iterator it  :list L ){

 

If A --do something ........etc

 

if(key = D){

D= callTheQuerywhichusesA&B&C();

 

}

Posted

yeah iterate chesthuna...and value set back ela cheyali aa element ki

Iteration time lo

 

for( Iterator it  :list L ){

 

If A --do something ........etc

 

if(key = D){

D= callTheQuerywhichusesA&B&C();

 

}

 

Posted

yeah iterate chesthuna...and value set back ela cheyali aa element ki


Setback means u need to replace D with the result frpm the method ??
Posted

Are u thinking of changing the value of the key ? 

Posted

If you want to replace d get the index of it and use set method to replace it

×
×
  • Create New...