KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jacorb > test > bugs > bug228 > SampleDefaultFactory


1 package org.jacorb.test.bugs.bug228;
2
3 import java.io.Serializable JavaDoc;
4
5 import org.omg.CORBA_2_3.portable.InputStream JavaDoc;
6
7 /*
8  * JacORB - a free Java ORB
9  *
10  * Copyright (C) 1997-2003 Gerald Brose.
11  *
12  * This library is free software; you can redistribute it and/or
13  * modify it under the terms of the GNU Library General Public
14  * License as published by the Free Software Foundation; either
15  * version 2 of the License, or (at your option) any later version.
16  *
17  * This library is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20  * Library General Public License for more details.
21  *
22  * You should have received a copy of the GNU Library General Public
23  * License along with this library; if not, write to the Free
24  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
25  */

26
27 /**
28  * @author <a HREF="mailto:spiegel@gnu.org">Andre Spiegel</a>
29  * @version $Id: SampleDefaultFactory.java,v 1.1 2003/08/31 13:13:29 andre.spiegel Exp $
30  */

31 public class SampleDefaultFactory implements SampleValueFactory
32 {
33
34     public Sample init_1()
35     {
36         return new SampleIm();
37     }
38
39     public Sample init_2(int alpha, double beta, String JavaDoc gamma)
40     {
41         Sample result = new SampleIm();
42         result.alpha = alpha;
43         result.beta = beta;
44         result.gamma = gamma;
45         return result;
46     }
47
48     public Serializable JavaDoc read_value(InputStream JavaDoc is)
49     {
50         Sample result = new SampleIm();
51         result._read (is);
52         return result;
53     }
54
55 }
56
Popular Tags