01: /*
02: * JacORB - a free Java ORB
03: *
04: * Copyright (C) 1997-2004 Gerald Brose.
05: *
06: * This library is free software; you can redistribute it and/or
07: * modify it under the terms of the GNU Library General Public
08: * License as published by the Free Software Foundation; either
09: * 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: public class BindNode {
27: protected Binding binding;
28: protected String typeID;
29: public boolean matched;
30: public boolean used;
31:
32: public BindNode(Binding b) {
33: binding = b;
34: used = false;
35: }
36:
37: public boolean equals(BindNode bnode) {
38: return toString().equals(bnode.toString());
39: }
40:
41: public Binding getBinding() {
42: return binding;
43: }
44:
45: public NameComponent[] getName() {
46: return binding.binding_name;
47: }
48:
49: public String getTypeID() {
50: return typeID;
51: }
52:
53: public boolean isContext() {
54: return binding.binding_type.value() == BindingType._ncontext;
55: }
56:
57: public void setTypeID(String id) {
58: typeID = id;
59: }
60:
61: /**
62: * String representation of this Nodes
63: */
64:
65: public String toString() {
66: NameComponent[] name = binding.binding_name;
67: /*
68: StringBuffer str=new StringBuffer(name[name.length-1].id);
69: if (name[name.length-1].kind.length()>0)
70: str.append(" ("+name[name.length-1].kind+")");
71: return new String(str);
72: */
73: return name[name.length - 1].id;
74: }
75: }
|