RSE
Release 2.0

org.eclipse.rse.core.references
Interface IRSEBasePersistableReferenceManager

All Known Subinterfaces:
ISystemFilterPoolReferenceManager

public interface IRSEBasePersistableReferenceManager


Method Summary
 int addReferencingObject(IRSEBasePersistableReferencingObject object)
          Add a referencing object to the managed list.
 String getName()
           
 IRSEBasePersistableReferencingObject getReferencedObject(IRSEBasePersistableReferencedObject object)
          Search list of referencing objects to see if one of them references the given referencable object.
 int getReferencingObjectCount()
          Return how many referencing objects are currently in the list.
 List getReferencingObjectList()
           
 int getReferencingObjectPosition(IRSEBasePersistableReferencingObject object)
          Return the zero-based position of the given referencing object within the list.
 IRSEBasePersistableReferencingObject[] getReferencingObjects()
          Return an array of the referencing objects currently being managed.
 boolean isReferenced(IRSEBasePersistableReferencedObject object)
          Return true if the given referencable object is indeed referenced by a referencing object in the current list.
 void moveReferencingObjectPosition(int newPosition, IRSEBasePersistableReferencingObject object)
          Move the given referencing object to a new zero-based position in the list.
 void removeAllReferencingObjects()
          Remove all objects from the list.
 void removeAndDeReferenceAllReferencingObjects()
          Remove and dereference all objects from the list.
 int removeAndDeReferenceReferencingObject(IRSEBasePersistableReferencingObject object)
          Remove and dereferences a referencing object from the managed list.
 int removeReferencingObject(IRSEBasePersistableReferencingObject object)
          Remove a referencing object from the managed list.
 boolean resolveReferencesAfterRestore()
          After restoring this from disk, there is only the referenced object name, not the referenced object pointer, for each referencing object.
 void save(IFolder folder, String fileName)
          Attempt to save contents of manager to disk.
 void setName(String value)
           
 void setReferencingObjects(IRSEBasePersistableReferencingObject[] objects, boolean deReference)
          Set in one shot the list of referencing objects.
 

Method Detail

getReferencingObjects

IRSEBasePersistableReferencingObject[] getReferencingObjects()
Return an array of the referencing objects currently being managed.

Returns:
array of the referencing objects currently in this list.

setReferencingObjects

void setReferencingObjects(IRSEBasePersistableReferencingObject[] objects,
                           boolean deReference)
Set in one shot the list of referencing objects. Replaces current list.

Parameters:
objects - An array of referencing objects which is to become the new list.
deReference - true to first de-reference all objects in the existing list.

addReferencingObject

int addReferencingObject(IRSEBasePersistableReferencingObject object)
Add a referencing object to the managed list.

Returns:
new count of referenced objects being managed.

removeReferencingObject

int removeReferencingObject(IRSEBasePersistableReferencingObject object)
Remove a referencing object from the managed list.

Does NOT call removeReference on the master referenced object.

Returns:
new count of referenced objects being managed.

removeAndDeReferenceReferencingObject

int removeAndDeReferenceReferencingObject(IRSEBasePersistableReferencingObject object)
Remove and dereferences a referencing object from the managed list.

DOES call removeReference on the master referenced object.

Returns:
new count of referenced objects being managed.

removeAllReferencingObjects

void removeAllReferencingObjects()
Remove all objects from the list.

Does NOT call removeReference on the master referenced objects.


removeAndDeReferenceAllReferencingObjects

void removeAndDeReferenceAllReferencingObjects()
Remove and dereference all objects from the list.

DOES call removeReference on the master referenced objects.


getReferencingObjectCount

int getReferencingObjectCount()
Return how many referencing objects are currently in the list.

Returns:
current count of referenced objects being managed.

getReferencingObjectPosition

int getReferencingObjectPosition(IRSEBasePersistableReferencingObject object)
Return the zero-based position of the given referencing object within the list. Does a memory address comparison (==) to find the object.

Parameters:
object - The referencing object to find position of.
Returns:
zero-based position within the list. If not found, returns -1

moveReferencingObjectPosition

void moveReferencingObjectPosition(int newPosition,
                                   IRSEBasePersistableReferencingObject object)
Move the given referencing object to a new zero-based position in the list.

Parameters:
newPosition - New zero-based position
object - The referencing object to move

isReferenced

boolean isReferenced(IRSEBasePersistableReferencedObject object)
Return true if the given referencable object is indeed referenced by a referencing object in the current list. This is done by comparing the reference names of each, not the in-memory pointers.

Parameters:
object - The referencable object to which to search for a referencing object within this list
Returns:
true if found in list, false otherwise.

getReferencedObject

IRSEBasePersistableReferencingObject getReferencedObject(IRSEBasePersistableReferencedObject object)
Search list of referencing objects to see if one of them references the given referencable object. This is done by comparing the reference names of each, not the in-memory pointers.

Parameters:
object - The referencable object to which to search for a referencing object within this list
Returns:
the referencing object within this list which references the given referencable object, or null if no reference found.

save

void save(IFolder folder,
          String fileName)
          throws Exception
Attempt to save contents of manager to disk. Only call if not doing your own save from your own model that uses a subclass of this.

Parameters:
folder - The folder in which to save the manager.
fileName - The unqualified file name to save to. Should include extension, such as .xmi
Throws:
Exception

resolveReferencesAfterRestore

boolean resolveReferencesAfterRestore()
After restoring this from disk, there is only the referenced object name, not the referenced object pointer, for each referencing object.

This method is called after restore and for each restored object in the list must:

  1. Do what is necessary to find the referenced object, and set the internal reference pointer.
  2. Call addReference(this) on that object so it can maintain it's in-memory list of all referencing objects.

Returns:
true if resolved successfully. False if some references were not found and hence those referencing objects removed from the restored list.

getName

String getName()
Returns:
The value of the Name attribute

setName

void setName(String value)
Parameters:
value - The new value of the Name attribute

getReferencingObjectList

List getReferencingObjectList()
Returns:
The list of ReferencingObjectList references

RSE
Release 2.0

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