KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jacorb > orb > NamedValue


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

20
21 package org.jacorb.orb;
22
23 /**
24  * @author Gerald Brose, FU Berlin
25  * @version $Id: NamedValue.java,v 1.7 2004/05/06 12:40:00 nicolas Exp $
26  */

27
28 public class NamedValue
29     extends org.omg.CORBA.NamedValue JavaDoc
30 {
31     private org.omg.CORBA.Any JavaDoc value;
32     private String JavaDoc name;
33     private int arg_modes;
34
35     public NamedValue(int modes)
36     {
37     arg_modes = modes;
38     }
39
40     public NamedValue( String JavaDoc n, org.omg.CORBA.Any JavaDoc a, int modes )
41     {
42     name = n;
43     value = a;
44     arg_modes = modes;
45     }
46
47     public NamedValue( String JavaDoc n, int modes )
48     {
49     name = n;
50     arg_modes = modes;
51     }
52     
53     public java.lang.String JavaDoc name()
54     {
55     return name;
56     }
57
58     public org.omg.CORBA.Any JavaDoc value()
59     {
60     return value;
61     }
62     
63     public int flags()
64     {
65     return arg_modes;
66     }
67
68     public void set_value( org.omg.CORBA.Any JavaDoc v )
69     {
70     value = v;
71     }
72
73     /** JacORB-specific */
74
75     public void send(org.omg.CORBA.portable.OutputStream JavaDoc out )
76     {
77     value().write_value(out);
78     }
79
80     public void receive(org.omg.CORBA.portable.InputStream JavaDoc in )
81     {
82     value().read_value(in, value().type());
83     }
84
85
86 }
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
Popular Tags