/** Returns a hard reference to the object that is kept weak by this class. *@return a hard reference to the XWeak implementation. */ public Object get() { if (m_listener != null) return m_listener.get(); return null; } }
/** Creates an instance of this class. *@param obj XWeak implementation */ public WeakReference(Object obj) { XWeak weak= UnoRuntime.queryInterface(XWeak.class, obj); if (weak != null) { XAdapter adapter= (XAdapter) weak.queryAdapter(); if (adapter != null) m_listener= new OWeakRefListener(adapter); } } /** Returns a hard reference to the object that is kept weak by this class.
/** * Creates an instance of this class. * * @param obj XWeak implementation. */ public WeakReference(Object obj) { XWeak weak= UnoRuntime.queryInterface(XWeak.class, obj); if (weak != null) { XAdapter adapter= weak.queryAdapter(); if (adapter != null) m_listener= new OWeakRefListener(adapter); } }
/** Creates an instance of this class. *@param obj - another instance that is to be copied */ public WeakReference(WeakReference obj) { if (obj != null) { Object weakImpl= obj.get(); if (weakImpl != null) { XWeak weak= UnoRuntime.queryInterface(XWeak.class, weakImpl); if (weak != null) { XAdapter adapter= (XAdapter) weak.queryAdapter(); if (adapter != null) m_listener= new OWeakRefListener(adapter); } } } }
/** * Returns a hard reference to the object that is kept weak by this class. * * @return a hard reference to the XWeak implementation. */ public Object get() { if (m_listener != null) return m_listener.get(); return null; } }
/** * Creates an instance of this class. * * @param obj another instance that is to be copied. */ public WeakReference(WeakReference obj) { if (obj == null) { return; } Object weakImpl = obj.get(); if (weakImpl == null) { return; } XWeak weak = UnoRuntime.queryInterface(XWeak.class, weakImpl); if (weak != null) { XAdapter adapter = weak.queryAdapter(); if (adapter != null) m_listener = new OWeakRefListener(adapter); } }