cancel
Showing results for 
Search instead for 
Did you mean: 

Java Function result.addValue(newValue)?

Former Member
0 Kudos

Hi All,

Could you tell me what this function does?

result.addValue(newValue);

Regards,

XIer

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

addValue(new Value) is one of methods of class ResultList.

ResultList supports the methods and constants

- void addValue(String)

- void addContextChange() *

- void addSuppress() *

- void clear()

- ResultList.CC (context change) *

- ResultList.SUPPRESS (suppressed value) *

addValue is the method used in advanced function to build the queue in output of the function.

I remember that only with queue functions you can use "*" methods

Former Member
0 Kudos

Hi

the java function result.addValue()

if you use the function as result.addValue("");

then this will generate a balnk node.

n if you use the function as result.addValue("A");

then it will give the output as A.

Thanks

Rinku

Former Member
0 Kudos

HI,

result.addvalue will add value to your output array. If you look at your function one of the paramete is result..which is nothing but your output Array.

So after processing data you can add data to output using result.addValue("New value")

Hope this wull help.

Let us know if you need more details.

Nilesh

Former Member
0 Kudos

but will the function collect all the items and then return or it would return the value everytime we add new data to it?

XIer

justin_santhanam
Active Contributor
0 Kudos

Xier,

Consider the below example

My input xml looks like

<Record>

<row>

<Value>1</Value>

</row>

<row>

<Value>1</Value>

</row>

<row>

<Value>1</Value>

</row>

<row>

<Value>3</Value>

</row>

<row>

<Value>5</Value>

</row>

<row>

<Value>44</Value>

</row>

<row>

<Value>55</Value>

</row>

<row>

<Value>66</Value>

</row>

Then if you want to take all the values of element <Value> ,then

u must write,

for (int j =0;j<input.length;j++)

{

<b>result.addValue(input[j]) ;</b>

}

So the above UDF will add all the Value element into single queue as below picture.

http://flickr.com/photo_zoom.gne?id=798590221&size=o

If it's not clear, reply back.

raj.

justin_santhanam
Active Contributor
0 Kudos

Xier,

It will add the value to the result list.

raj.