当前位置: 首页>>代码示例>>Java>>正文


Java Delegate.equals方法代码示例

本文整理汇总了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;
}
 
开发者ID:vilie,项目名称:javify,代码行数:18,代码来源:StubDelegateImpl.java

示例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;
}
 
开发者ID:vilie,项目名称:javify,代码行数:52,代码来源:AOM.java

示例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;
}
 
开发者ID:nmldiegues,项目名称:jvm-stm,代码行数:52,代码来源:AOM.java


注:本文中的org.omg.CORBA.portable.Delegate.equals方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。