KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jacorb > ir > StringDef


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

22
23 import org.omg.CORBA.INTF_REPOS JavaDoc;
24
25 public class StringDef
26     extends IDLType
27     implements org.omg.CORBA.StringDefOperations JavaDoc
28 {
29     private int bound;
30
31     /** for subclasses only */
32     protected StringDef(){}
33
34     public StringDef(org.omg.CORBA.TypeCode JavaDoc tc)
35     {
36         if (tc.kind () != org.omg.CORBA.TCKind.tk_string)
37         {
38             throw new INTF_REPOS JavaDoc ("Precondition volation: TypeCode must be of kind string");
39         }
40
41         def_kind = org.omg.CORBA.DefinitionKind.dk_String;
42         type = tc;
43         try
44         {
45             bound( tc.length());
46         }
47         catch( Exception JavaDoc e )
48         {
49             e.printStackTrace(); // should not happen
50
}
51     }
52
53     public int bound()
54     {
55         return bound;
56     }
57
58     public void bound(int arg)
59     {
60         bound = arg;
61     }
62
63     public void define()
64     {
65     }
66
67     public void destroy()
68     {
69     }
70
71 }
72
Popular Tags