org.eclipse.xtext.resource.impl
Class EObjectDescriptionLookUp

java.lang.Object
  extended by org.eclipse.xtext.resource.impl.EObjectDescriptionLookUp
All Implemented Interfaces:
ISelectable

public class EObjectDescriptionLookUp
extends java.lang.Object
implements ISelectable

Author:
Sebastian Zarnekow - Initial contribution and API, Sven Efftinge

Constructor Summary
EObjectDescriptionLookUp(java.util.List<IEObjectDescription> allDescriptions)
           
 
Method Summary
 java.lang.Iterable<IEObjectDescription> getExportedObjects()
           
 java.lang.Iterable<IEObjectDescription> getExportedObjects(org.eclipse.emf.ecore.EClass type, QualifiedName name, boolean ignoreCase)
           
 java.lang.Iterable<IEObjectDescription> getExportedObjectsByObject(org.eclipse.emf.ecore.EObject object)
           
 java.lang.Iterable<IEObjectDescription> getExportedObjectsByType(org.eclipse.emf.ecore.EClass type)
           
protected  java.util.Map<QualifiedName,java.util.List<IEObjectDescription>> getNameToObjects()
           
 boolean isEmpty()
          Clients may want to check the selectable to skip its processing in case it is empty.
protected  void putIntoMap(java.util.Map<QualifiedName,java.util.List<IEObjectDescription>> nameToObjects, IEObjectDescription description)
           
 void setExportedObjects(java.util.List<IEObjectDescription> allDescriptions)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EObjectDescriptionLookUp

public EObjectDescriptionLookUp(java.util.List<IEObjectDescription> allDescriptions)
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
Returns:
true if the selectable does not provide any descriptions.

getExportedObjectsByType

public java.lang.Iterable<IEObjectDescription> getExportedObjectsByType(org.eclipse.emf.ecore.EClass type)
Specified by:
getExportedObjectsByType in interface ISelectable
Returns:
all elements which match the given type. May not be null.

getExportedObjectsByObject

public java.lang.Iterable<IEObjectDescription> getExportedObjectsByObject(org.eclipse.emf.ecore.EObject object)
Specified by:
getExportedObjectsByObject in interface ISelectable
Returns:
all elements which match the given instance. May not be null.

getExportedObjects

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

getExportedObjects

public java.lang.Iterable<IEObjectDescription> getExportedObjects()
Specified by:
getExportedObjects in interface ISelectable
Returns:
all exported elements. May not be null.

setExportedObjects

public void setExportedObjects(java.util.List<IEObjectDescription> allDescriptions)

getNameToObjects

protected java.util.Map<QualifiedName,java.util.List<IEObjectDescription>> getNameToObjects()

putIntoMap

protected void putIntoMap(java.util.Map<QualifiedName,java.util.List<IEObjectDescription>> nameToObjects,
                          IEObjectDescription description)