It's a jess.ValueVector:
ValueVector vv = m_station.listValue(null);
ValueVector is a class kind of like java.util.Value. If you want to
get an array, then you have to build it by hand, as ValueVector has
no API for that. You'd do something like
ArrayList list = new ArrayList();
for (int i=0; i<vv.size(); ++i)
list.add(vv.get(i).stringValue(null);
String[] array = (String[]) list.toArray(new String[vv.size()]);
On Apr 2, 2007, at 10:34 PM, ricktee wrote:
Good day!
I have the following java code to get a variable "station" from a
Jess fact
using Jess defquery. Inside the station fact, the list looks
something like
(S1 S4 S5). Is there a way or method to directly convert it into a
java
string array {"S1", "S4", "S5"}
Value m_station= result.get("station");
String [] temp1 = m_station.toString(String[].class);
I have tried using the above code to convert "station" as a string
array
into temp1. I read the topic on
JESS: java array + jess RU.LIST by u01jmg3
but I couldnt understand. Sorry if this question has been ask before.
thanks again
best rgds
rick
--
View this message in context: http://www.nabble.com/Converting-
Queryresult-value-into-java-string-array-tf3509509.html#a9802738
Sent from the Jess mailing list archive at Nabble.com.
--------------------------------------------------------------------
To unsubscribe, send the words 'unsubscribe jess-users
[EMAIL PROTECTED]'
in the BODY of a message to [EMAIL PROTECTED], NOT to the list
(use your own address!) List problems? Notify owner-jess-
[EMAIL PROTECTED]
--------------------------------------------------------------------
---------------------------------------------------------
Ernest Friedman-Hill
Advanced Software Research Phone: (925) 294-2154
Sandia National Labs FAX: (925) 294-2234
PO Box 969, MS 9012 [EMAIL PROTECTED]
Livermore, CA 94550 http://www.jessrules.com
--------------------------------------------------------------------
To unsubscribe, send the words 'unsubscribe jess-users [EMAIL PROTECTED]'
in the BODY of a message to [EMAIL PROTECTED], NOT to the list
(use your own address!) List problems? Notify [EMAIL PROTECTED]
--------------------------------------------------------------------