本文整理汇总了Java中com.sun.corba.se.impl.orbutil.graph.Graph类的典型用法代码示例。如果您正苦于以下问题:Java Graph类的具体用法?Java Graph怎么用?Java Graph使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Graph类属于com.sun.corba.se.impl.orbutil.graph包,在下文中一共展示了Graph类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: ClassDataImpl
import com.sun.corba.se.impl.orbutil.graph.Graph; //导入依赖的package包/类
public ClassDataImpl( Class cls )
{
this.cls = cls ;
Graph gr = new GraphImpl() ;
NodeImpl root = new NodeImpl( cls ) ;
Set rootSet = getRootSet( cls, root, gr ) ;
// At this point, rootSet contains those remote interfaces
// that are not related by inheritance, and gr contains
// all reachable remote interfaces.
Class[] interfaces = getInterfaces( rootSet ) ;
nameTranslator = IDLNameTranslatorImpl.get( interfaces ) ;
typeIds = makeTypeIds( root, gr, rootSet ) ;
ihfactory = new InvocationHandlerFactoryImpl(
PresentationManagerImpl.this, this ) ;
dictionary = new HashMap() ;
}
示例2: makeTypeIds
import com.sun.corba.se.impl.orbutil.graph.Graph; //导入依赖的package包/类
private String[] makeTypeIds( NodeImpl root, Graph gr, Set rootSet )
{
Set nonRootSet = new HashSet( gr ) ;
nonRootSet.removeAll( rootSet ) ;
// List<String> for the typeids
List result = new ArrayList() ;
if (rootSet.size() > 1) {
// If the rootSet has more than one element, we must
// put the type id of the implementation class first.
// Root represents the implementation class here.
result.add( root.getTypeId() ) ;
}
addNodes( result, rootSet ) ;
addNodes( result, nonRootSet ) ;
return (String[])result.toArray( new String[result.size()] ) ;
}
示例3: getRootSet
import com.sun.corba.se.impl.orbutil.graph.Graph; //导入依赖的package包/类
private Set getRootSet( Class target, NodeImpl root, Graph gr )
{
Set rootSet = null ;
if (target.isInterface()) {
gr.add( root ) ;
rootSet = gr.getRoots() ; // rootSet just contains root here
} else {
// Use this class and its superclasses (not Object) as initial roots
Class superclass = target ;
Set initialRootSet = new HashSet() ;
while ((superclass != null) && !superclass.equals( Object.class )) {
Node node = new NodeImpl( superclass ) ;
gr.add( node ) ;
initialRootSet.add( node ) ;
superclass = superclass.getSuperclass() ;
}
// Expand all nodes into the graph
gr.getRoots() ;
// remove the roots and find roots again
gr.removeAll( initialRootSet ) ;
rootSet = gr.getRoots() ;
}
return rootSet ;
}