UML Modeling Layer

com.ibm.xtools.uml.msl.resources
Interface ILogicalResource

All Known Subinterfaces:
ILogicalUMLResource
All Known Implementing Classes:
LogicalUMLResource, UnknownLogicalUMLResource, UnloadedLogicalUMLResource

public interface ILogicalResource

Logical resource, comprised of the root resource and a number of fragments. The logical resource might be composed of only one resource, in which case it has only the root resource and no fragments.


Method Summary
 boolean contains(Resource resource)
          Tests if the specified resource is part of this logical resource.
 List<Resource> getAllFragments()
          Returns list of all fragments (loaded and unloaded).
 List<Resource> getAllLoadedResources()
          Returns list of all loaded resources in the logical resource.
 List<Resource> getAllResources()
          Returns list of all resources (loaded and unloaded) in the logical resource.
 ILogicalUnit getHierarchicalStructure()
          Builds and returns hierarchical structure of the logical resource.
 List<Resource> getLoadedFragments()
          Returns list of loaded fragments.
 List<Resource> getModifiedResources()
          Returns list of modified resources.
 Resource getRootResource()
          Returns the root resource.
 boolean isModified()
          Returns indicator if the logical resource is modified.
 

Method Detail

getRootResource

Resource getRootResource()
Returns the root resource.

Returns:
The root resource

getLoadedFragments

List<Resource> getLoadedFragments()
Returns list of loaded fragments.

Returns:
List of loaded fragments. The list is the copy of the internal structure so modifying it will not modify the structure of the logical resource.

getAllFragments

List<Resource> getAllFragments()
Returns list of all fragments (loaded and unloaded). This method is expensive as it potentially can cause parsing of unloaded resources. It should be used with extreme care.

Returns:
List of all fragments (loaded and unloaded). The list is the copy of the internal structure so modifying it will not modify the structure of the logical resource.

getAllResources

List<Resource> getAllResources()
Returns list of all resources (loaded and unloaded) in the logical resource. This method is expensive as it potentially can cause parsing of unloaded resources. It should be used with extreme care.

Returns:
List of all resources (loaded and unloaded). The first element in the list is the root resource. The list is the copy of the internal structure so modifying it will not modify the structure of the logical resource.

getAllLoadedResources

List<Resource> getAllLoadedResources()
Returns list of all loaded resources in the logical resource.

Returns:
All loaded resources. The first element in the list is the root resource - if it is loaded. The list is the copy of the internal structure so modifying it will not modify the structure of the logical resource.

getModifiedResources

List<Resource> getModifiedResources()
Returns list of modified resources.

Returns:
All modified resources (root resource and/or fragments). The list is the copy of the internal structure so modifying it will not modify the structure of the logical resource.

isModified

boolean isModified()
Returns indicator if the logical resource is modified. The logical resource is considered modified if at least one of its resources is modified.

Returns:
'true' if the logical resource is modified; 'false' otherwise

contains

boolean contains(Resource resource)
Tests if the specified resource is part of this logical resource. This method is expensive when invoked for a closed (unloaded) resource as it potentially can cause parsing of unloaded resources. There is no negative performance impact when used for a loaded resource. It should be used with extreme care.

Parameters:
resource - The resource to be tested
Returns:
'true' if the specified resource is part of this logical resource; 'false' otherwise

getHierarchicalStructure

ILogicalUnit getHierarchicalStructure()
Builds and returns hierarchical structure of the logical resource. The structure is a snapshot at the time of the call and is not dynamically updated.

Returns:
The logical unit of the top resource in the hierarchical structure

UML Modeling Layer

© Copyright IBM Corp. 2009. All rights reserved.