org.eclipse.xtext.resource.containers
Class FilterUriContainer

java.lang.Object
  extended by org.eclipse.xtext.resource.impl.AbstractCompoundSelectable
      extended by org.eclipse.xtext.resource.impl.AbstractContainer
          extended by org.eclipse.xtext.resource.containers.FilterUriContainer
All Implemented Interfaces:
IContainer, ISelectable

public class FilterUriContainer
extends AbstractContainer

A container that virtually removes a resource description with a given uri from another container.

Author:
Holger Schill - Initial contribution and API, Sebastian Zarnekow - Optimizations and Javadoc

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.eclipse.xtext.resource.IContainer
IContainer.Manager
 
Field Summary
 
Fields inherited from interface org.eclipse.xtext.resource.IContainer
NULL_CONTAINER
 
Constructor Summary
FilterUriContainer(org.eclipse.emf.common.util.URI filterMe, IContainer delegate)
           
 
Method Summary
 java.lang.Iterable<IEObjectDescription> getExportedObjects(org.eclipse.emf.ecore.EClass type, QualifiedName qualifiedName, boolean ignoreCase)
           
 IResourceDescription getResourceDescription(org.eclipse.emf.common.util.URI uri)
           
 int getResourceDescriptionCount()
           
 java.lang.Iterable<IResourceDescription> getResourceDescriptions()
           
 boolean hasResourceDescription(org.eclipse.emf.common.util.URI uri)
           
 boolean isEmpty()
          Clients may want to check the selectable to skip its processing in case it is empty.
 
Methods inherited from class org.eclipse.xtext.resource.impl.AbstractContainer
getExportedObjectsByObject, getSelectables
 
Methods inherited from class org.eclipse.xtext.resource.impl.AbstractCompoundSelectable
getExportedObjects, getExportedObjectsByType
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.eclipse.xtext.resource.ISelectable
getExportedObjects, getExportedObjectsByType
 

Constructor Detail

FilterUriContainer

public FilterUriContainer(org.eclipse.emf.common.util.URI filterMe,
                          IContainer delegate)
Method Detail

isEmpty

public boolean isEmpty()
Description copied from interface: ISelectable
Clients may want to check the selectable to skip its processing in case it is empty. Implementations should be fast and not require expensive precalculation. Selectable may return false if it is too expensive to compute the actual result.

Specified by:
isEmpty in interface ISelectable
Overrides:
isEmpty in class AbstractCompoundSelectable
Returns:
true if the selectable does not provide any descriptions.

hasResourceDescription

public boolean hasResourceDescription(org.eclipse.emf.common.util.URI uri)
Specified by:
hasResourceDescription in interface IContainer
Overrides:
hasResourceDescription in class AbstractContainer
Returns:
true if the container can provide a resource description with the given uri.

getResourceDescriptionCount

public int getResourceDescriptionCount()
Specified by:
getResourceDescriptionCount in interface IContainer
Overrides:
getResourceDescriptionCount in class AbstractContainer
Returns:
the total number of resource descriptions returned by IContainer.getResourceDescriptions()

getResourceDescriptions

public java.lang.Iterable<IResourceDescription> getResourceDescriptions()
Returns:
the IResourceDescription contained in this container. The result is never null. The result may be a cached view on the actual content of the underlying resources.

getExportedObjects

public java.lang.Iterable<IEObjectDescription> getExportedObjects(org.eclipse.emf.ecore.EClass type,
                                                                  QualifiedName qualifiedName,
                                                                  boolean ignoreCase)
Specified by:
getExportedObjects in interface ISelectable
Overrides:
getExportedObjects in class AbstractCompoundSelectable
Returns:
all elements which match the given qualified name and type. May not be null.

getResourceDescription

public IResourceDescription getResourceDescription(org.eclipse.emf.common.util.URI uri)
Specified by:
getResourceDescription in interface IContainer
Overrides:
getResourceDescription in class AbstractContainer
Returns:
the IResourceDescription for the given URI, or null is this container does not contain such an IResourceDescription. The result may be a cached view on the actual content of the underlying resource.