KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jacorb > naming > namemanager > BindNode


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.naming.namemanager;
22
23 import org.omg.CosNaming.*;
24 import org.jacorb.naming.*;
25
26
27 public class BindNode
28 {
29     protected Binding binding;
30     protected String JavaDoc typeID;
31     public boolean matched;
32     public boolean used;
33
34     public BindNode(Binding b)
35     {
36         binding=b;
37         used=false;
38     }
39     public boolean equals(BindNode bnode)
40     {
41         return toString().equals(bnode.toString());
42     }
43     public Binding getBinding()
44     {
45         return binding;
46     }
47     public NameComponent[] getName()
48     {
49         return binding.binding_name;
50     }
51     public String JavaDoc getTypeID()
52     {
53         return typeID;
54     }
55     public boolean isContext()
56     {
57         return binding.binding_type.value()==BindingType._ncontext;
58     }
59     public void setTypeID(String JavaDoc id)
60     {
61         typeID=id;
62     }
63
64     /**
65      * String representation of this Nodes
66      */

67
68     public String JavaDoc toString()
69     {
70         NameComponent[] name=binding.binding_name;
71         /*
72           StringBuffer str=new StringBuffer(name[name.length-1].id);
73           if (name[name.length-1].kind.length()>0)
74           str.append(" ("+name[name.length-1].kind+")");
75           return new String(str);
76         */

77         return name[name.length-1].id;
78     }
79 }
80
81
82
Popular Tags