00001 /* 00002 ** Author(s): Miguel Calejo 00003 ** Contact: interprolog@declarativa.com, http://www.declarativa.com 00004 ** Copyright (C) Declarativa, Portugal, 2000-2002 00005 ** Use and distribution, without any warranties, under the terms of the 00006 ** GNU Library General Public License, readable in http://www.fsf.org/copyleft/lgpl.html 00007 */ 00008 package com.declarativa.interprolog.util; 00009 import java.io.Serializable; 00010 import com.declarativa.interprolog.*; 00012 public class ResultFromJava implements Serializable{ 00013 int timestamp; // same as of the corresponding MessageFromProlog 00014 Object result; 00018 public Object /*instead of Exception... to avoid serialization difficulties...*/ exception; 00020 Object[] arguments; 00021 public ResultFromJava(int t,Object r,Object e,Object[] a){ 00022 timestamp=t; result=r; exception=e; 00023 if (a==null) arguments = new Object[0]; 00024 else arguments=a; 00025 } 00026 public String toString(){ 00027 StringBuffer args = new StringBuffer(500); 00028 for (int i=0; i<arguments.length; i++) 00029 args.append(PrologEngine.nl+"arguments["+i+"]="+arguments[i]); 00030 return "timestamp="+timestamp+PrologEngine.nl+"result="+result+PrologEngine.nl+"exception="+exception+args; 00031 } 00032 } 00033