Java Code Examples for org.eclipse.emf.common.util.ECollections#toEList()

The following examples show how to use org.eclipse.emf.common.util.ECollections#toEList() . 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 File: VariableDeclarationOrBindingImpl.java    From n4js with Eclipse Public License 1.0 6 votes vote down vote up
/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
@Override
public EList<VariableDeclaration> getVariableDeclarations() {
	EList<VariableDeclaration> _switchResult = null;
	boolean _matched = false;
	if (this instanceof VariableDeclaration) {
		_matched=true;
		_switchResult = ECollections.<VariableDeclaration>toEList(java.util.Collections.<VariableDeclaration>unmodifiableList(org.eclipse.xtext.xbase.lib.CollectionLiterals.<VariableDeclaration>newArrayList(((VariableDeclaration) this))));
	}
	if (!_matched) {
		if (this instanceof VariableBinding) {
			_matched=true;
			_switchResult = ECollections.<VariableDeclaration>toEList(Iterators.<VariableDeclaration>filter(this.eAllContents(), VariableDeclaration.class));
		}
	}
	if (!_matched) {
		_switchResult = ECollections.<VariableDeclaration>toEList(java.util.Collections.<VariableDeclaration>unmodifiableList(org.eclipse.xtext.xbase.lib.CollectionLiterals.<VariableDeclaration>newArrayList()));
	}
	return _switchResult;
}
 
Example 2
Source File: VariableDeclarationContainerImpl.java    From n4js with Eclipse Public License 1.0 5 votes vote down vote up
/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
@Override
public EList<VariableDeclaration> getVarDecl() {
	final Function1<VariableDeclarationOrBinding, EList<VariableDeclaration>> _function = new Function1<VariableDeclarationOrBinding, EList<VariableDeclaration>>() {
		public EList<VariableDeclaration> apply(final VariableDeclarationOrBinding it) {
			return it.getVariableDeclarations();
		}
	};
	return ECollections.<VariableDeclaration>toEList(Iterables.<VariableDeclaration>concat(XcoreEListExtensions.<VariableDeclarationOrBinding, EList<VariableDeclaration>>map(this.getVarDeclsOrBindings(), _function)));
}
 
Example 3
Source File: VariableStatementImpl.java    From n4js with Eclipse Public License 1.0 5 votes vote down vote up
/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
@Override
public EList<VariableDeclaration> getVarDecl() {
	final Function1<VariableDeclarationOrBinding, EList<VariableDeclaration>> _function = new Function1<VariableDeclarationOrBinding, EList<VariableDeclaration>>() {
		public EList<VariableDeclaration> apply(final VariableDeclarationOrBinding it) {
			return it.getVariableDeclarations();
		}
	};
	return ECollections.<VariableDeclaration>toEList(Iterables.<VariableDeclaration>concat(XcoreEListExtensions.<VariableDeclarationOrBinding, EList<VariableDeclaration>>map(this.getVarDeclsOrBindings(), _function)));
}
 
Example 4
Source File: DocletImpl.java    From n4js with Eclipse Public License 1.0 5 votes vote down vote up
/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
@Override
public EList<LineTag> lineTags(final String title) {
	final Function1<LineTag, Boolean> _function = new Function1<LineTag, Boolean>() {
		public Boolean apply(final LineTag it) {
			String _title = it.getTitle().getTitle();
			return Boolean.valueOf(Objects.equal(_title, title));
		}
	};
	return ECollections.<LineTag>toEList(IterableExtensions.<LineTag>filter(this.getLineTags(), _function));
}
 
Example 5
Source File: SwitchStatementImpl.java    From n4js with Eclipse Public License 1.0 2 votes vote down vote up
/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
@Override
public EList<CaseClause> getCaseClauses() {
	return ECollections.<CaseClause>toEList(Iterables.<CaseClause>filter(this.getCases(), CaseClause.class));
}