本文整理汇总了Java中org.omg.CORBA.portable.Delegate.equals方法的典型用法代码示例。如果您正苦于以下问题:Java Delegate.equals方法的具体用法?Java Delegate.equals怎么用?Java Delegate.equals使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.omg.CORBA.portable.Delegate
的用法示例。
在下文中一共展示了Delegate.equals方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: equals
import org.omg.CORBA.portable.Delegate; //导入方法依赖的package包/类
/**
* Compare two stubs for equality.
*/
public boolean equals(Stub self, java.lang.Object obj)
{
if (obj instanceof ObjectImpl)
{
ObjectImpl other = (ObjectImpl) obj;
Delegate d1 = other._get_delegate();
Delegate d2 = self._get_delegate();
if (d1 == null || d2 == null)
return d1 == d2;
else
return d1.equals(d2);
}
else return false;
}
示例2: findObject
import org.omg.CORBA.portable.Delegate; //导入方法依赖的package包/类
/**
* Get the record of the stored object. If the object is mapped several times
* under the different keys, one of the mappings is used.
*
* @param stored_object the stored object
*
* @return the record about the stored object, null if this object is not
* stored here.
*/
public Obj findObject(org.omg.CORBA.Object stored_object)
{
if (stored_object == null)
return null;
Map.Entry item;
Iterator iter;
Obj ref;
if (stored_object instanceof ObjectImpl)
{
// If the delegate is available, search by delegate.
Delegate d = ((ObjectImpl) stored_object)._get_delegate();
Delegate d2;
if (d != null)
{
iter = objects.entrySet().iterator();
while (iter.hasNext())
{
item = (Map.Entry) iter.next();
ref = (Obj) item.getValue();
d2 = ref.object._get_delegate();
if (d == d2 || (d2 != null && d2.equals(d)))
return ref;
}
}
}
// For other objects (or if not possible to get the delegate),
// search by .equals
iter = objects.entrySet().iterator();
while (iter.hasNext())
{
item = (Map.Entry) iter.next();
ref = (Obj) item.getValue();
if (stored_object.equals(ref.object))
return ref;
}
return null;
}
示例3: findObject
import org.omg.CORBA.portable.Delegate; //导入方法依赖的package包/类
/**
* Get the record of the stored object. If the object is mapped several times
* under the different keys, one of the mappings is used.
*
* @param stored_object the stored object
*
* @return the record about the stored object, null if this object is not
* stored here.
*/
public Obj findObject(org.omg.CORBA.Object stored_object)
{
if (stored_object == null)
return null;
Map.Entry item;
Iterator iter;
Obj ref;
if (stored_object instanceof ObjectImpl)
{
// If the delegate is available, search by delegate.
Delegate d = ((ObjectImpl) stored_object)._get_delegate();
Delegate d2;
if (d != null)
{
iter = objects.entrySet().iterator();
while (iter.hasNext())
{
item = (Map.Entry) iter.next();
ref = (Obj) item.getValue();
d2 = ref.object._get_delegate();
if (d == d2 || (d2 != null && d2.equals(d)))
return ref;
}
}
}
// For other objects (or if not possible to get the delegate),
// search by .equals
iter = objects.entrySet().iterator();
while (iter.hasNext())
{
item = (Map.Entry) iter.next();
ref = (Obj) item.getValue();
if (stored_object.equals(ref.object))
return ref;
}
return null;
}