Re: [eclipse-clp-users] How to dynamically create a list of Eclipse structure elements from Java (Eclipse-Java embedding problem)??

From: Kish Shen <kisshen_at_cisco.com>
Date: Mon, 28 Dec 2009 19:53:06 +0000
Tobiasz Kowalczyk wrote:
> Hello
> 
> I have a problem, I have an CSV file which I can read from,with a few
> columns containing numbers. I parse them in Java and would like to
> create a list of elements of a certain structure and fill the fields
> with data that I have read from the CSV file. Any hints?? (example: it
> could be a list of shifts in a hospital for a week or a month (that is
> why it has to be dynamic) where structure would contain the number of
> a particular shift, number of doctors,number of nurses,etc. (different
> for different shifts))
> 
> I would appreciate any help
> 
> Tobias

Hi Tobias,

If your structures are relatively simple (most importantly, there are no 
shared variables -- the same variable occurring in different places in 
the structure), you can build the structures in ECLiPSe's Java 
interface, see the Embedding and Interfacing manual's chapter on the 
Java-ECLiPSe interface, section "Java representation of ECLiPSe data":

http://www.eclipse-clp.org/doc/embedding/embroot044.html

However, it is usually much easier to construct ECLiPSe structures from 
within ECLiPSe. In your case, if you already have Java code to parse the 
   files, then it may be better to send the parsed data to ECLiPSe and 
construct the list of structures there [I assume you want to use the 
data in an ECLiPSe program in any case].

Cheers,

Kish

-- 
This e-mail may contain confidential and privileged material for the
sole use of the intended recipient. Any review, use, distribution or
disclosure by others is strictly prohibited. If you are not the intended
recipient (or authorized to receive for the recipient), please contact
the sender by reply e-mail and delete all copies of this message.
Cisco Systems Limited (Company Number: 02558939), is registered in
England and Wales with its registered office at 1 Callaghan Square,
Cardiff, South Glamorgan CF10 5BT.
Received on Mon Dec 28 2009 - 19:53:19 CET

This archive was generated by hypermail 2.2.0 : Thu Feb 02 2012 - 02:31:58 CET