RSE
Release 3.3

org.eclipse.rse.core.references
Class SystemReferencingObjectHelper

java.lang.Object
  extended by org.eclipse.rse.core.references.SystemReferencingObjectHelper

public class SystemReferencingObjectHelper
extends Object

The class should be used by subclasses of SystemReferencingObject by instantiating it and delegating to it.

Since:
org.eclipse.rse.core 3.0

Constructor Summary
SystemReferencingObjectHelper(IRSEBaseReferencingObject caller)
          Default constructor.
SystemReferencingObjectHelper(IRSEBaseReferencingObject caller, IRSEBaseReferencedObject obj)
          Constructor that saves effort of calling setReferencedObject.
 
Method Summary
 IRSEBaseReferencedObject getReferencedObject()
          Get the object which is referenced.
 int removeReference()
          Removes this reference from the referenced object and clears this reference.
 void setReferencedObject(IRSEBaseReferencedObject obj)
          Set the object to which this reference will point.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SystemReferencingObjectHelper

public SystemReferencingObjectHelper(IRSEBaseReferencingObject caller)
Default constructor.

Parameters:
caller - the reference that this object is helping.

SystemReferencingObjectHelper

public SystemReferencingObjectHelper(IRSEBaseReferencingObject caller,
                                     IRSEBaseReferencedObject obj)
Constructor that saves effort of calling setReferencedObject.

Parameters:
caller - the reference that this object is helping.
obj - the object to which this reference will point.
Method Detail

setReferencedObject

public void setReferencedObject(IRSEBaseReferencedObject obj)
Set the object to which this reference will point. Stores the reference in memory, replacing whatever was there. Also calls obj.addReference(caller);

Parameters:
obj - the object to which this reference will point.

getReferencedObject

public IRSEBaseReferencedObject getReferencedObject()
Get the object which is referenced. May be null if the reference is not set or has not been resolved.

Returns:
the referenced object.

removeReference

public int removeReference()
Removes this reference from the referenced object and clears this reference. Also, nulls out our memory reference.

Returns:
new reference count of master object

RSE
Release 3.3

Copyright (c) IBM Corporation and others 2000, 2011. All Rights Reserved.