Java 类org.eclipse.emf.ecore.util.EcoreUtil.ContentTreeIterator 实例源码

项目:xtext-extras    文件:XbaseUsageCrossReferencer.java   
@Override
protected TreeIterator<Notifier> newContentsIterator() {
    return new ContentTreeIterator<Notifier>(emfObjects) {
        private static final long serialVersionUID = 1L;

        @Override
        protected Iterator<? extends EObject> getEObjectChildren(EObject eObject) {
            if(eObject instanceof XAbstractFeatureCall){
                Iterable<EObject> result = eObject.eContents();
                XAbstractFeatureCall featureCall = (XAbstractFeatureCall) eObject;
                XExpression implicitReceiver = featureCall.getImplicitReceiver();
                if(implicitReceiver != null) 
                    result = Iterables.concat(result, Collections.singleton(implicitReceiver));
                XExpression implicitFirstArgument = featureCall.getImplicitFirstArgument();
                if(implicitFirstArgument != null)
                    result = Iterables.concat(result, Collections.singleton(implicitFirstArgument));
                return result.iterator();
            } else 
                return super.getEObjectChildren(eObject);
        }
    };
}
项目:eclipse-avro    文件:ResourceImpl.java   
protected TreeIterator<EObject> getAllProperContents(List<EObject> contents)
{
  return
    new ContentTreeIterator<EObject>(contents, false)
    {
      private static final long serialVersionUID = 1L;

      @SuppressWarnings("unchecked")
      @Override
      public Iterator<EObject> getChildren(Object object)
      {
        return
          object == this.object ?
            ((List<EObject>)object).iterator() :
            new ProperContentIterator<EObject>(((EObject)object));
      }
    };
}
项目:clickwatch    文件:ResourceImpl.java   
protected TreeIterator<EObject> getAllProperContents(List<EObject> contents)
{
  return
    new ContentTreeIterator<EObject>(contents, false)
    {
      private static final long serialVersionUID = 1L;

      @SuppressWarnings("unchecked")
      @Override
      public Iterator<EObject> getChildren(Object object)
      {
        return
          object == this.object ?
            ((List<EObject>)object).iterator() :
            new ProperContentIterator<EObject>(((EObject)object));
      }
    };
}