org.eclipse.emf.common.util.BasicEList Java Examples

The following examples show how to use org.eclipse.emf.common.util.BasicEList. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source Project: sarl   Author: sarl   File: DefaultActionPrototypeProviderTest.java    License: Apache License 2.0 6 votes vote down vote up
@Test
public void createPrototypeFromJvmModel_void() {
	JvmIdentifiableElement container = createJvmIdentifiableElementStub();
	QualifiedActionName qn = this.provider.createQualifiedActionName(container, "myfct");
	EList<JvmFormalParameter> params = new BasicEList<>();
	//
	InferredPrototype prototype = this.provider.createPrototypeFromJvmModel(this.context, qn, false, params);
	assertNotNull(prototype);
	assertEquals("myfct", prototype.getActionName().getActionName());
	assertSameJvmFormalParameters(params, prototype.getFormalParameters());
	assertEquals("", prototype.getFormalParameterTypes().toString());
	assertContainsStrings(
			prototype.getParameterTypeAlternatives(),
			"");
	assertTrue(prototype.getInferredParameterTypes().isEmpty());
}
 
Example #2
Source Project: smarthome   Author: eclipse-archived   File: SitemapSubscriptionService.java    License: Eclipse Public License 2.0 6 votes vote down vote up
private EList<Widget> collectWidgets(String sitemapName, String pageId) {
    EList<Widget> widgets = new BasicEList<Widget>();

    Sitemap sitemap = getSitemap(sitemapName);
    if (sitemap != null) {
        if (pageId.equals(sitemap.getName())) {
            widgets = itemUIRegistry.getChildren(sitemap);
        } else {
            Widget pageWidget = itemUIRegistry.getWidget(sitemap, pageId);
            if (pageWidget instanceof LinkableWidget) {
                widgets = itemUIRegistry.getChildren((LinkableWidget) pageWidget);
                // We add the page widget. It will help any UI to update the page title.
                widgets.add(pageWidget);
            }
        }
    }
    return widgets;
}
 
Example #3
Source Project: bonita-studio   Author: bonitasoft   File: UpdateConnectorDefinitionMigrationTest.java    License: GNU General Public License v2.0 6 votes vote down vote up
@Test
public void should_migrateAfter_update_definitionVersion_in_connector() throws Exception {
    //Given
    doCallRealMethod().when(updateConnectorVersionMigration).migrateAfter(model, metamodel);
    final EList<Instance> connectorInstanceList = connectorInstanceList("id1","id2");
    final Instance oldConnectorInstance = aConnectorInstance("id1", "0.9");
    connectorInstanceList.add(oldConnectorInstance);
    when(model.getAllInstances("process.Connector")).thenReturn(connectorInstanceList);
    when(model.getAllInstances("connectorconfiguration.ConnectorConfiguration")).thenReturn(new BasicEList<Instance>());
    when(updateConnectorVersionMigration.shouldUpdateVersion("id1")).thenReturn(true);
    when(updateConnectorVersionMigration.getOldDefinitionVersion()).thenReturn("1.0");
    when(updateConnectorVersionMigration.getNewDefinitionVersion()).thenReturn("2.0");


    //When
    updateConnectorVersionMigration.migrateAfter(model, metamodel);

    //Then
    final Instance id1Connector = connectorInstanceList.get(0);
    final Instance id2Connector = connectorInstanceList.get(1);
    verify(id1Connector).set(UpdateConnectorDefinitionMigration.DEFINITION_VERSION_FEATURE_NAME, "2.0");
    verify(id2Connector, never()).set(UpdateConnectorDefinitionMigration.DEFINITION_VERSION_FEATURE_NAME, "2.0");
    verify(oldConnectorInstance, never()).set(UpdateConnectorDefinitionMigration.DEFINITION_VERSION_FEATURE_NAME, "2.0");
}
 
Example #4
Source Project: n4js   Author: eclipse   File: N4JSResource.java    License: Eclipse Public License 1.0 6 votes vote down vote up
/**
 * This is aware of warnings from the {@link N4JSStringValueConverter}.
 *
 * Issues from the parser are commonly treated as errors but here we want to create a warning.
 */
@Override
protected void addSyntaxErrors() {
	if (isValidationDisabled())
		return;
	// EList.add unnecessarily checks for uniqueness by default
	// so we use #addUnique below to save some CPU cycles for heavily broken
	// models
	BasicEList<Diagnostic> errorList = (BasicEList<Diagnostic>) getErrors();
	BasicEList<Diagnostic> warningList = (BasicEList<Diagnostic>) getWarnings();

	for (INode error : getParseResult().getSyntaxErrors()) {
		processSyntaxDiagnostic(error, diagnostic -> {
			String code = diagnostic.getCode();
			Severity severity = IssueCodes.getDefaultSeverity(code);
			if (AbstractN4JSStringValueConverter.WARN_ISSUE_CODE.equals(code)
					|| RegExLiteralConverter.ISSUE_CODE.equals(code)
					|| LegacyOctalIntValueConverter.ISSUE_CODE.equals(code)
					|| severity == Severity.WARNING) {
				warningList.addUnique(diagnostic);
			} else if (!InternalSemicolonInjectingParser.SEMICOLON_INSERTED.equals(code)) {
				errorList.addUnique(diagnostic);
			}
		});
	}
}
 
Example #5
Source Project: n4js   Author: eclipse   File: ConcreteSyntaxAwareReferenceFinder.java    License: Eclipse Public License 1.0 6 votes vote down vote up
@Override
public void findReferences(Predicate<URI> targetURIs, Resource resource, Acceptor acceptor,
		IProgressMonitor monitor) {
	// make sure data is present
	keys.getData((TargetURIs) targetURIs, new SimpleResourceAccess(resource.getResourceSet()));
	EList<EObject> astContents;
	if (resource instanceof N4JSResource) {
		// In case of N4JSResource, we search only in the AST but NOT in TModule tree!
		Script script = (Script) ((N4JSResource) resource).getContents().get(0);
		astContents = new BasicEList<>();
		astContents.add(script);
	} else {
		astContents = resource.getContents();
	}
	for (EObject content : astContents) {
		findReferences(targetURIs, content, acceptor, monitor);
	}
}
 
Example #6
Source Project: n4js   Author: eclipse   File: ComposedMemberInfo.java    License: Eclipse Public License 1.0 6 votes vote down vote up
private void handleFParameters(TMember member, RuleEnvironment G) {
	EList<TFormalParameter> fpars = null;
	if (member instanceof TMethod) {
		TMethod method = (TMethod) member;
		fpars = method.getFpars();
	}
	if (member instanceof TSetter) {
		TSetter setter = (TSetter) member;
		fpars = new BasicEList<>();
		fpars.add(setter.getFpar());
	}
	if (fpars != null) {
		for (int i = 0; i < fpars.size(); i++) {
			TFormalParameter fpar = fpars.get(i);
			if (fParameters.size() <= i) {
				fParameters.add(new ComposedFParInfo());
			}
			ComposedFParInfo fpAggr = fParameters.get(i);
			Pair<TFormalParameter, RuleEnvironment> fpPair = new Pair<>(fpar, G);
			fpAggr.fpSiblings.add(fpPair);
		}
	}
}
 
Example #7
Source Project: smarthome   Author: eclipse-archived   File: ItemUIRegistryImplTest.java    License: Eclipse Public License 2.0 6 votes vote down vote up
@Test
public void testStateConversionForSwitchWidgetWithMappingThroughGetState() throws ItemNotFoundException {
    State colorState = new HSBType("23,42,50");

    ColorItem colorItem = new ColorItem("myItem");
    colorItem.setLabel("myItem");
    colorItem.setState(colorState);

    when(registry.getItem("myItem")).thenReturn(colorItem);

    Switch switchWidget = mock(Switch.class);
    when(switchWidget.getItem()).thenReturn("myItem");

    Mapping mapping = mock(Mapping.class);
    BasicEList<Mapping> mappings = new BasicEList<Mapping>();
    mappings.add(mapping);
    when(switchWidget.getMappings()).thenReturn(mappings);

    State stateForSwitch = uiRegistry.getState(switchWidget);

    assertEquals(colorState, stateForSwitch);
}
 
Example #8
Source Project: bonita-studio   Author: bonitasoft   File: UpdateConnectorDefinitionMigrationTest.java    License: GNU General Public License v2.0 6 votes vote down vote up
@Test
public void should_migrateAfter_update_version_in_connector_configuration() throws Exception {
    //Given
    doCallRealMethod().when(updateConnectorVersionMigration).migrateAfter(model, metamodel);
    final EList<Instance> connectorConfigInstanceList = connectorConfiguratiobInstanceList("id1", "id2");
    final Instance oldConnectorConfInstance = aConnectorConfigurationInstance("id1", "0.9");
    connectorConfigInstanceList.add(oldConnectorConfInstance);
    when(model.getAllInstances("connectorconfiguration.ConnectorConfiguration")).thenReturn(connectorConfigInstanceList);
    when(model.getAllInstances("process.Connector")).thenReturn(new BasicEList<Instance>());
    when(updateConnectorVersionMigration.shouldUpdateVersion("id1")).thenReturn(true);
    when(updateConnectorVersionMigration.getOldDefinitionVersion()).thenReturn("1.0");
    when(updateConnectorVersionMigration.getNewDefinitionVersion()).thenReturn("2.0");

    //When
    updateConnectorVersionMigration.migrateAfter(model, metamodel);

    //Then
    final Instance id1ConnectorConf = connectorConfigInstanceList.get(0);
    final Instance id2ConnectorConf = connectorConfigInstanceList.get(1);
    verify(id1ConnectorConf).set(UpdateConnectorDefinitionMigration.VERSION_FEATURE_NAME, "2.0");
    verify(id2ConnectorConf, never()).set(UpdateConnectorDefinitionMigration.VERSION_FEATURE_NAME, "2.0");
    verify(oldConnectorConfInstance, never()).set(UpdateConnectorDefinitionMigration.VERSION_FEATURE_NAME, "2.0");
}
 
Example #9
Source Project: xtext-extras   Author: eclipse   File: JvmAnnotationReferenceImplCustom.java    License: Eclipse Public License 2.0 6 votes vote down vote up
@Override
public EList<JvmAnnotationValue> getValues() {
	EList<JvmAnnotationValue> explicitValues = getExplicitValues();
	List<JvmOperation> operations = Lists.newArrayList(getAnnotation().getDeclaredOperations());
	if (operations.size() <= explicitValues.size()) {
		return ECollections.unmodifiableEList(explicitValues);
	}
	Set<JvmOperation> seenOperations = Sets.newHashSetWithExpectedSize(operations.size());
	BasicEList<JvmAnnotationValue> result = new BasicEList<JvmAnnotationValue>(operations.size());
	for(JvmAnnotationValue value: explicitValues) {
		seenOperations.add(value.getOperation());
		result.add(value);
	}
	for(JvmOperation operation: operations) {
		if (seenOperations.add(operation)) {
			JvmAnnotationValue defaultValue = operation.getDefaultValue();
			if (defaultValue != null) {
				result.add(defaultValue);
			}
		}
	}
	return ECollections.unmodifiableEList(result);
}
 
Example #10
Source Project: dsl-devkit   Author: dsldevkit   File: EObjectContentProviderTest.java    License: Eclipse Public License 1.0 6 votes vote down vote up
/**
 * Mocks XtextEditor and XtextElementSelectionListener to return an element selection that has:
 * - given EAttribute with a specific value (AttributeValuePair)
 * - given EStructuralFeature
 * - given EOperation.
 *
 * @param attributeValuePair
 *          EAttribute with a specific value
 * @param feature
 *          the EStructuralFeature
 * @param operation
 *          the EOperation
 * @return the EClass of the "selected" element
 */
@SuppressWarnings("unchecked")
private EClass mockSelectedElement(final AttributeValuePair attributeValuePair, final EStructuralFeature feature, final EOperation operation) {
  EClass mockSelectionEClass = mock(EClass.class);
  when(mockSelectionListener.getSelectedElementType()).thenReturn(mockSelectionEClass);
  // Mockups for returning AttributeValuePair
  URI elementUri = URI.createURI("");
  when(mockSelectionListener.getSelectedElementUri()).thenReturn(elementUri);
  XtextEditor mockEditor = mock(XtextEditor.class);
  when(mockSelectionListener.getEditor()).thenReturn(mockEditor);
  IXtextDocument mockDocument = mock(IXtextDocument.class);
  when(mockEditor.getDocument()).thenReturn(mockDocument);
  when(mockDocument.<ArrayList<AttributeValuePair>> readOnly(any(IUnitOfWork.class))).thenReturn(newArrayList(attributeValuePair));
  // Mockups for returning EOperation
  BasicEList<EOperation> mockEOperationsList = new BasicEList<EOperation>();
  mockEOperationsList.add(operation);
  when(mockSelectionEClass.getEAllOperations()).thenReturn(mockEOperationsList);
  // Mockups for returning EStructuralFeature
  BasicEList<EStructuralFeature> mockEStructuralFeatureList = new BasicEList<EStructuralFeature>();
  mockEStructuralFeatureList.add(feature);
  mockEStructuralFeatureList.add(attributeValuePair.getAttribute());
  when(mockSelectionEClass.getEAllStructuralFeatures()).thenReturn(mockEStructuralFeatureList);
  return mockSelectionEClass;
}
 
Example #11
Source Project: openhab-core   Author: openhab   File: ItemUIRegistryImpl.java    License: Eclipse Public License 2.0 6 votes vote down vote up
@Override
public EList<Widget> getChildren(LinkableWidget w) {
    EList<Widget> widgets = null;
    if (w instanceof Group && w.getChildren().isEmpty()) {
        widgets = getDynamicGroupChildren((Group) w);
    } else {
        widgets = w.getChildren();
    }

    EList<Widget> result = new BasicEList<>();
    for (Widget widget : widgets) {
        Widget resolvedWidget = resolveDefault(widget);
        if (resolvedWidget != null) {
            result.add(resolvedWidget);
        }
    }
    return result;
}
 
Example #12
Source Project: smarthome   Author: eclipse-archived   File: ItemUIRegistryImpl.java    License: Eclipse Public License 2.0 6 votes vote down vote up
@Override
public EList<Widget> getChildren(LinkableWidget w) {
    EList<Widget> widgets = null;
    if (w instanceof Group && w.getChildren().isEmpty()) {
        widgets = getDynamicGroupChildren((Group) w);
    } else {
        widgets = w.getChildren();
    }

    EList<Widget> result = new BasicEList<Widget>();
    for (Widget widget : widgets) {
        Widget resolvedWidget = resolveDefault(widget);
        if (resolvedWidget != null) {
            result.add(resolvedWidget);
        }
    }
    return result;
}
 
Example #13
Source Project: openhab-core   Author: openhab   File: ItemUIRegistryImplTest.java    License: Eclipse Public License 2.0 6 votes vote down vote up
@Test
public void testStateConversionForSwitchWidgetThroughGetState() throws ItemNotFoundException {
    State colorState = new HSBType("23,42,50");

    ColorItem colorItem = new ColorItem("myItem");
    colorItem.setLabel("myItem");
    colorItem.setState(colorState);

    when(registry.getItem("myItem")).thenReturn(colorItem);

    Switch switchWidget = mock(Switch.class);
    when(switchWidget.getItem()).thenReturn("myItem");
    when(switchWidget.getMappings()).thenReturn(new BasicEList<>());

    State stateForSwitch = uiRegistry.getState(switchWidget);

    assertEquals(OnOffType.ON, stateForSwitch);
}
 
Example #14
Source Project: smarthome   Author: eclipse-archived   File: ItemUIRegistryImplTest.java    License: Eclipse Public License 2.0 6 votes vote down vote up
@Test
public void testStateConversionForSwitchWidgetThroughGetState() throws ItemNotFoundException {
    State colorState = new HSBType("23,42,50");

    ColorItem colorItem = new ColorItem("myItem");
    colorItem.setLabel("myItem");
    colorItem.setState(colorState);

    when(registry.getItem("myItem")).thenReturn(colorItem);

    Switch switchWidget = mock(Switch.class);
    when(switchWidget.getItem()).thenReturn("myItem");
    when(switchWidget.getMappings()).thenReturn(new BasicEList<Mapping>());

    State stateForSwitch = uiRegistry.getState(switchWidget);

    assertEquals(OnOffType.ON, stateForSwitch);
}
 
Example #15
Source Project: sarl   Author: sarl   File: DefaultActionPrototypeProviderTest.java    License: Apache License 2.0 6 votes vote down vote up
@Test
public void createPrototypeFromJvmModel_void() {
	JvmIdentifiableElement container = createJvmIdentifiableElementStub();
	QualifiedActionName qn = this.provider.createQualifiedActionName(container, "myfct");
	EList<JvmFormalParameter> params = new BasicEList<>();
	//
	InferredPrototype prototype = this.provider.createPrototypeFromJvmModel(this.context, qn, false, params);
	assertNotNull(prototype);
	assertEquals("myfct", prototype.getActionName().getActionName());
	assertSameJvmFormalParameters(params, prototype.getFormalParameters());
	assertEquals("", prototype.getFormalParameterTypes().toString());
	assertContainsStrings(
			prototype.getParameterTypeAlternatives(),
			"");
	assertTrue(prototype.getInferredParameterTypes().isEmpty());
}
 
Example #16
Source Project: statecharts   Author: Yakindu   File: TypesUtil.java    License: Eclipse Public License 1.0 6 votes vote down vote up
private static void prependContainingFeatureName(StringBuilder id, EObject container) {
	EStructuralFeature feature = container.eContainingFeature();
	if (feature != null) {
		String name;
		if (feature.isMany()) {
			Object elements = container.eContainer().eGet(feature);
			int index = 0;
			if (elements instanceof BasicEList) {
				BasicEList<?> elementList = (BasicEList<?>) elements;
				index = elementList.indexOf(container);
			}
			name = feature.getName() + index;
		} else {
			name = feature.getName();
		}
		id.insert(0, ID_SEPARATOR);
		id.insert(0, name);
	}
}
 
Example #17
Source Project: sarl   Author: sarl   File: DefaultActionPrototypeProviderTest.java    License: Apache License 2.0 5 votes vote down vote up
@Test
public void createParameterTypesFromSarlModell_void() {
	ActionParameterTypes key = this.provider.createParameterTypesFromSarlModel(false,
			new BasicEList<SarlFormalParameter>());
	assertNotNull(key);
	assertFalse(key.isVarArg());
	assertTrue(key.isVoid());
	assertTrue(key.isEmpty());
}
 
Example #18
Source Project: sarl   Author: sarl   File: SARLLabelProviderTest.java    License: Apache License 2.0 5 votes vote down vote up
private <T extends XtendMember> T mockMember(Class<T> type, JvmVisibility visibility, JvmMember member) {
	T m = mock(type);
	when(m.getVisibility()).thenReturn(visibility);
	if (member != null) {
		EList<Adapter> adapters = new BasicEList<>();
		adapters.add(new JvmModelAssociator.Adapter());
		XtextResource r = mock(XtextResource.class);
		when(r.getLanguageName()).thenReturn("io.sarl.lang.SARL"); //$NON-NLS-1$
		when(r.eAdapters()).thenReturn(adapters);
		when(member.eResource()).thenReturn(r);
		when(m.eResource()).thenReturn(r);
		this.jvmModelAssociator.associate(m, member);
	}
	return m;
}
 
Example #19
Source Project: smarthome   Author: eclipse-archived   File: GenericThingProviderMultipleBundlesTest.java    License: Eclipse Public License 2.0 5 votes vote down vote up
private EList<ModelThing> createModelBridge() {
    ModelBridge bridge = mock(ModelBridge.class);
    when(bridge.getId()).thenReturn(BRIDGE_UID.toString());
    when(bridge.getProperties()).thenReturn(new BasicEList<>(0));
    when(bridge.getChannels()).thenReturn(new BasicEList<>(0));

    EList<ModelThing> modelThings = createModelThing();
    when(bridge.getThings()).thenReturn(modelThings);

    BasicEList<ModelThing> result = new BasicEList<ModelThing>();
    result.add(bridge);
    return result;
}
 
Example #20
Source Project: n4js   Author: eclipse   File: VariableDeclarationImpl.java    License: Eclipse Public License 1.0 5 votes vote down vote up
/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
@Override
public EList<Annotation> getAllAnnotations() {
	final BasicEList<Annotation> result = XcoreCollectionLiterals.<Annotation>newBasicEList();
	final EObject parent = this.eContainer();
	if ((parent instanceof ExportDeclaration)) {
		EList<Annotation> _annotations = ((ExportDeclaration)parent).getAnnotations();
		Iterables.<Annotation>addAll(result, _annotations);
	}
	EList<Annotation> _annotations_1 = this.getAnnotations();
	Iterables.<Annotation>addAll(result, _annotations_1);
	return result;
}
 
Example #21
Source Project: n4js   Author: eclipse   File: N4MemberAnnotationListImpl.java    License: Eclipse Public License 1.0 5 votes vote down vote up
/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
@Override
public EList<Annotation> getAllAnnotations() {
	final BasicEList<Annotation> result = XcoreCollectionLiterals.<Annotation>newBasicEList();
	final EObject parent = this.eContainer();
	if ((parent instanceof ExportDeclaration)) {
		EList<Annotation> _annotations = ((ExportDeclaration)parent).getAnnotations();
		Iterables.<Annotation>addAll(result, _annotations);
	}
	EList<Annotation> _annotations_1 = this.getAnnotations();
	Iterables.<Annotation>addAll(result, _annotations_1);
	return result;
}
 
Example #22
Source Project: n4js   Author: eclipse   File: N4ClassifierDeclarationImpl.java    License: Eclipse Public License 1.0 5 votes vote down vote up
/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
@Override
public EList<N4MemberDeclaration> getOwnedMembers() {
	final Function1<N4MemberDeclaration, Boolean> _function = new Function1<N4MemberDeclaration, Boolean>() {
		public Boolean apply(final N4MemberDeclaration it) {
			boolean _isCallableConstructor = it.isCallableConstructor();
			return Boolean.valueOf((!_isCallableConstructor));
		}
	};
	final Iterable<N4MemberDeclaration> methods = IterableExtensions.<N4MemberDeclaration>filter(Iterables.<N4MemberDeclaration>filter(this.getOwnedMembersRaw(), N4MemberDeclaration.class), _function);
	List<N4MemberDeclaration> _list = IterableExtensions.<N4MemberDeclaration>toList(methods);
	return new BasicEList<N4MemberDeclaration>(_list);
}
 
Example #23
Source Project: n4js   Author: eclipse   File: N4ClassifierDeclarationImpl.java    License: Eclipse Public License 1.0 5 votes vote down vote up
/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
@Override
public EList<N4MethodDeclaration> getOwnedMethods() {
	final Function1<N4MethodDeclaration, Boolean> _function = new Function1<N4MethodDeclaration, Boolean>() {
		public Boolean apply(final N4MethodDeclaration it) {
			return Boolean.valueOf(((!it.isConstructor()) && (!it.isCallableConstructor())));
		}
	};
	final Iterable<N4MethodDeclaration> methods = IterableExtensions.<N4MethodDeclaration>filter(Iterables.<N4MethodDeclaration>filter(this.getOwnedMembersRaw(), N4MethodDeclaration.class), _function);
	List<N4MethodDeclaration> _list = IterableExtensions.<N4MethodDeclaration>toList(methods);
	return new BasicEList<N4MethodDeclaration>(_list);
}
 
Example #24
Source Project: n4js   Author: eclipse   File: N4ClassifierDeclarationImpl.java    License: Eclipse Public License 1.0 5 votes vote down vote up
/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
@Override
public EList<N4FieldDeclaration> getOwnedFields() {
	final Iterable<N4FieldDeclaration> fields = Iterables.<N4FieldDeclaration>filter(this.getOwnedMembersRaw(), N4FieldDeclaration.class);
	List<N4FieldDeclaration> _list = IterableExtensions.<N4FieldDeclaration>toList(fields);
	return new BasicEList<N4FieldDeclaration>(_list);
}
 
Example #25
Source Project: n4js   Author: eclipse   File: N4ClassifierDeclarationImpl.java    License: Eclipse Public License 1.0 5 votes vote down vote up
/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
@Override
public EList<N4GetterDeclaration> getOwnedGetters() {
	final Iterable<N4GetterDeclaration> getters = Iterables.<N4GetterDeclaration>filter(this.getOwnedMembersRaw(), N4GetterDeclaration.class);
	List<N4GetterDeclaration> _list = IterableExtensions.<N4GetterDeclaration>toList(getters);
	return new BasicEList<N4GetterDeclaration>(_list);
}
 
Example #26
Source Project: n4js   Author: eclipse   File: N4ClassifierDeclarationImpl.java    License: Eclipse Public License 1.0 5 votes vote down vote up
/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
@Override
public EList<N4SetterDeclaration> getOwnedSetters() {
	final Iterable<N4SetterDeclaration> setters = Iterables.<N4SetterDeclaration>filter(this.getOwnedMembersRaw(), N4SetterDeclaration.class);
	List<N4SetterDeclaration> _list = IterableExtensions.<N4SetterDeclaration>toList(setters);
	return new BasicEList<N4SetterDeclaration>(_list);
}
 
Example #27
Source Project: n4js   Author: eclipse   File: N4ClassifierDefinitionImpl.java    License: Eclipse Public License 1.0 5 votes vote down vote up
/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
@Override
public EList<N4MemberDeclaration> getOwnedMembers() {
	final Function1<N4MemberDeclaration, Boolean> _function = new Function1<N4MemberDeclaration, Boolean>() {
		public Boolean apply(final N4MemberDeclaration it) {
			boolean _isCallableConstructor = it.isCallableConstructor();
			return Boolean.valueOf((!_isCallableConstructor));
		}
	};
	final Iterable<N4MemberDeclaration> methods = IterableExtensions.<N4MemberDeclaration>filter(Iterables.<N4MemberDeclaration>filter(this.getOwnedMembersRaw(), N4MemberDeclaration.class), _function);
	List<N4MemberDeclaration> _list = IterableExtensions.<N4MemberDeclaration>toList(methods);
	return new BasicEList<N4MemberDeclaration>(_list);
}
 
Example #28
Source Project: n4js   Author: eclipse   File: N4ClassifierDefinitionImpl.java    License: Eclipse Public License 1.0 5 votes vote down vote up
/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
@Override
public EList<N4MethodDeclaration> getOwnedMethods() {
	final Function1<N4MethodDeclaration, Boolean> _function = new Function1<N4MethodDeclaration, Boolean>() {
		public Boolean apply(final N4MethodDeclaration it) {
			return Boolean.valueOf(((!it.isConstructor()) && (!it.isCallableConstructor())));
		}
	};
	final Iterable<N4MethodDeclaration> methods = IterableExtensions.<N4MethodDeclaration>filter(Iterables.<N4MethodDeclaration>filter(this.getOwnedMembersRaw(), N4MethodDeclaration.class), _function);
	List<N4MethodDeclaration> _list = IterableExtensions.<N4MethodDeclaration>toList(methods);
	return new BasicEList<N4MethodDeclaration>(_list);
}
 
Example #29
Source Project: n4js   Author: eclipse   File: N4ClassifierDefinitionImpl.java    License: Eclipse Public License 1.0 5 votes vote down vote up
/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
@Override
public EList<N4FieldDeclaration> getOwnedFields() {
	final Iterable<N4FieldDeclaration> fields = Iterables.<N4FieldDeclaration>filter(this.getOwnedMembersRaw(), N4FieldDeclaration.class);
	List<N4FieldDeclaration> _list = IterableExtensions.<N4FieldDeclaration>toList(fields);
	return new BasicEList<N4FieldDeclaration>(_list);
}
 
Example #30
Source Project: n4js   Author: eclipse   File: N4ClassifierDefinitionImpl.java    License: Eclipse Public License 1.0 5 votes vote down vote up
/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
@Override
public EList<N4SetterDeclaration> getOwnedSetters() {
	final Iterable<N4SetterDeclaration> setters = Iterables.<N4SetterDeclaration>filter(this.getOwnedMembersRaw(), N4SetterDeclaration.class);
	List<N4SetterDeclaration> _list = IterableExtensions.<N4SetterDeclaration>toList(setters);
	return new BasicEList<N4SetterDeclaration>(_list);
}