I think Tom Reinhardt wrote:
>
> "Batching" the "clp" file that contains this form plus a bunch of Materials seems to
>work just fine. In Jess, I can run:
>
> (bind ?materials (run-query findAllMaterials))
>
> and I get back a structure that I can treat as an Enumeration:
>
> (while (?materials hasMoreElements) ...)
>
> Now, I'd like to retrieve that Enumeration and use it within my Java code, perhaps
>to populate a drop-down list of Materials:
>
> Value value=m_rete.executeCommand("(run-query findAllMaterials)");
>
> What I get back looks like a java.util.Vector$<some-address> .... after calling the
>appropriate externalAddressValue function --to which I also provide the current Rete
>engine's context, although I surmise that this value is ignored. Unfortunately, I
>cannot really use this thing as a Java Vector. I cannot even typecast it to a Vector,
>for that matter.
The object is an instance of some class that implements the
Enumeration interface. Under old JDKs, it was a non-public class
called java.util.VectorEnumeration. In recent JDKs, it's an anonymous
inner class (a class with no name nested inside of Vector, like a
lambda only it's an object instead of a function.) If you call
toString on it, it will be something like
java.util.Vector$1@12345678. The "$1" means the first anonymous class
in Vector.
Anyway, do the same in Java as in Jess: cast to java.util.Enumeration,
and then access it as such.
>
> Clearly, I've misunderstood something here. So, if anyone has any idea of what I'm
>talking about, I'd appreciate a hint.
>
> Thanks,
>
> TomR
---------------------------------------------------------
Ernest Friedman-Hill
Distributed Systems Research Phone: (925) 294-2154
Sandia National Labs FAX: (925) 294-2234
Org. 8920, MS 9012 [EMAIL PROTECTED]
PO Box 969 http://herzberg.ca.sandia.gov
Livermore, CA 94550
---------------------------------------------------------------------
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]
---------------------------------------------------------------------