本文整理汇总了Java中org.eclipse.emf.common.util.ECollections.emptyEList方法的典型用法代码示例。如果您正苦于以下问题:Java ECollections.emptyEList方法的具体用法?Java ECollections.emptyEList怎么用?Java ECollections.emptyEList使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.emf.common.util.ECollections
的用法示例。
在下文中一共展示了ECollections.emptyEList方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: filter
import org.eclipse.emf.common.util.ECollections; //导入方法依赖的package包/类
/**
* Filters an {@link EList} of type T to contain only elements matching the provided predicate.
*
* @param <T>
* list element type
* @param unfiltered
* unfiltered list
* @param predicate
* to apply
* @return filtered list
*/
public static <T> EList<T> filter(final EList<T> unfiltered, final Predicate<? super T> predicate) {
if (unfiltered == null) {
return ECollections.emptyEList();
}
if (predicate == null) {
throw new IllegalArgumentException("predicate must not be null"); //$NON-NLS-1$
}
EList<T> filtered = new BasicEList<T>(unfiltered.size() / 2); // Initial guess: half the original size
for (T t : unfiltered) {
if (predicate.apply(t)) {
filtered.add(t);
}
}
return filtered;
}
示例2: generatePropertiesForCatalogsInConfigurableSection
import org.eclipse.emf.common.util.ECollections; //导入方法依赖的package包/类
/**
* Generate properties for languages or legacy catalogs.
*
* @param section
* the section
* @param properties
* the properties
*/
private void generatePropertiesForCatalogsInConfigurableSection(final ConfigurableSection section, final Properties properties) {
String language = null;
EList<ConfiguredCatalog> configuredCatalogs = ECollections.emptyEList();
if (section instanceof CheckConfiguration) {
configuredCatalogs = ((CheckConfiguration) section).getLegacyCatalogConfigurations();
} else if (section instanceof ConfiguredLanguageValidator) {
language = ((ConfiguredLanguageValidator) section).getLanguage();
configuredCatalogs = ((ConfiguredLanguageValidator) section).getCatalogConfigurations();
}
for (ConfiguredCatalog catalog : configuredCatalogs) {
Set<Check> configuredChecks = Sets.newHashSet();
for (ConfiguredCheck configuredCheck : catalog.getCheckConfigurations()) {
generatePropertiesForConfiguredCheck(properties, language, configuredCheck);
configuredChecks.add(configuredCheck.getCheck());
}
for (Check unconfiguredCheck : Sets.difference(Sets.newHashSet(catalog.getCatalog().getAllChecks()), configuredChecks)) {
putInheritedProperties(properties, language, unconfiguredCheck, catalog, ECollections.emptyEList());
}
}
}
示例3: getAllProvidedRuntimeLibraries
import org.eclipse.emf.common.util.ECollections; //导入方法依赖的package包/类
private EList<ProvidedRuntimeLibraryDependency> getAllProvidedRuntimeLibraries(N4JSProject project) {
URI projectLocation = project.getLocation();
if (projectLocation == null)
return ECollections.emptyEList();
ProjectDescription description = getProjectDescription(projectLocation);
if (description == null)
return ECollections.emptyEList();
EList<ProvidedRuntimeLibraryDependency> runtimeLibraries = description.getAllProvidedRuntimeLibraries();
if (runtimeLibraries == null)
return ECollections.emptyEList();
return runtimeLibraries;
}
示例4: getMasterOn
import org.eclipse.emf.common.util.ECollections; //导入方法依赖的package包/类
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @generated NOT
*/
@Override
public EList<MasterServer> getMasterOn ()
{
if ( getSourceMaster () != null && getSourceMaster ().getMaster () != null )
{
return ECollections.singletonEList ( getSourceMaster ().getMaster () );
}
else
{
return ECollections.emptyEList ();
}
}
示例5: getPossibleEndpoints
import org.eclipse.emf.common.util.ECollections; //导入方法依赖的package包/类
@Override
public EList<Endpoint> getPossibleEndpoints ( final Exporter exporter )
{
if ( ! ( exporter instanceof AlarmsEventsExporter ) )
{
return ECollections.emptyEList ();
}
return exporter.getEndpoints ();
}
示例6: getPossibleEndpoints
import org.eclipse.emf.common.util.ECollections; //导入方法依赖的package包/类
@Override
public EList<Endpoint> getPossibleEndpoints ( final Exporter exporter )
{
if ( ! ( exporter instanceof DataAccessExporter ) )
{
return ECollections.emptyEList ();
}
return exporter.getEndpoints ();
}
示例7: delegateBasicList
import org.eclipse.emf.common.util.ECollections; //导入方法依赖的package包/类
@Override
protected List<E> delegateBasicList()
{
int size = delegateSize();
if (size == 0)
{
return ECollections.emptyEList();
}
else
{
Object[] data = eStore().toArray(owner, eStructuralFeature);
return new EcoreEList.UnmodifiableEList<E>(owner, eStructuralFeature, data.length, data);
}
}
示例8: EObjectChange
import org.eclipse.emf.common.util.ECollections; //导入方法依赖的package包/类
public EObjectChange(EObject eObject) {
this(eObject, ECollections.emptyEList());
}
示例9: getChanges
import org.eclipse.emf.common.util.ECollections; //导入方法依赖的package包/类
public EList<FeatureChange> getChanges() {
return changes == null ? ECollections.emptyEList() : changes;
}
示例10: run
import org.eclipse.emf.common.util.ECollections; //导入方法依赖的package包/类
@Override
public java.util.Map<String, Model> run(
java.util.Map<String, Model> inputsByName, java.util.Map<String, GenericElement> genericsByName,
java.util.Map<String, MID> outputMIDsByName) throws Exception {
// input
List<Model> inputMIDModels = MIDOperatorIOUtils.getVarargs(inputsByName, IN_MIDS);
EList<MID> inputMIDs = ECollections.newBasicEList();
EList<Set<Model>> modelBlacklists = ECollections.newBasicEList();
for (Model inputMIDModel : inputMIDModels) {
inputMIDs.add((MID) inputMIDModel.getEMFInstanceRoot());
modelBlacklists.add(new HashSet<>());
}
Operator mapperOperatorType = (Operator) genericsByName.get(GENERIC_OPERATORTYPE);
java.util.Map<String, MID> instanceMIDsByMapperOutput = MIDOperatorIOUtils.getVarargOutputMIDsByOtherName(outputMIDsByName, OUT_MIDS, mapperOperatorType.getOutputs());
// find all possible combinations of inputs and execute them
java.util.Map<Operator, Set<EList<OperatorInput>>> mapperSpecs = new LinkedHashMap<>(); // reproducible order
EList<Operator> polyOperators = (Boolean.parseBoolean(MMINT.getPreference(MMINTConstants.PREFERENCE_MENU_POLYMORPHISM_MULTIPLEDISPATCH_ENABLED))) ?
ECollections.asEList(MIDTypeHierarchy.getSubtypes(mapperOperatorType)) :
ECollections.emptyEList();
if (polyOperators.isEmpty()) { // multiple dispatch disabled, or the mapper operator is not a multimethod
mapperSpecs.put(mapperOperatorType, mapperOperatorType.findAllowedInputs(inputMIDs, modelBlacklists));
}
else {
polyOperators.add(mapperOperatorType);
java.util.Map<String, EList<OperatorInput>> assignedInputs = new HashMap<>();
Iterator<Operator> polyIter = MIDTypeHierarchy.getInverseTypeHierarchyIterator(polyOperators);
while (polyIter.hasNext()) { // start from the most specialized operator backwards
Operator polyMapper = polyIter.next();
// assign at each step the allowed inputs that have not been already assigned
Set<EList<OperatorInput>> mapperInputs = polyMapper.findAllowedInputs(inputMIDs, modelBlacklists);
java.util.Map<String, EList<OperatorInput>> newInputs = this.diffMultipleDispatchInputs(assignedInputs, mapperInputs);
mapperSpecs.put(polyMapper, new LinkedHashSet<>(newInputs.values())); // reproducible order
assignedInputs.putAll(newInputs);
}
}
java.util.Map<String, Model> outputsByName = this.map(inputMIDModels, inputMIDs, mapperOperatorType, mapperSpecs, instanceMIDsByMapperOutput);
return outputsByName;
}
示例11: getEAllGenericSuperTypes
import org.eclipse.emf.common.util.ECollections; //导入方法依赖的package包/类
@Override
public EList<EGenericType> getEAllGenericSuperTypes() {
// @Correctness: get them from the supertypes?
return ECollections.emptyEList();
}
示例12: getEAllOperations
import org.eclipse.emf.common.util.ECollections; //导入方法依赖的package包/类
@Override
public EList<EOperation> getEAllOperations() {
// @Correctness: get them from the supertypes?
return ECollections.emptyEList();
}
示例13: convertToSubtype
import org.eclipse.emf.common.util.ECollections; //导入方法依赖的package包/类
/**
* Converts an {@link EList} of type S to an {@link EList} T, where T is a subtype of S.
*
* @param <S>
* original list type, supertype of T
* @param <T>
* target list type, subtype of S
* @param from
* list to convert
* @return converted list
*/
@SuppressWarnings("unchecked")
public static <S, T extends S> EList<T> convertToSubtype(final EList<S> from) {
if (from == null) {
return ECollections.emptyEList();
}
return (EList<T>) from;
}
示例14: convertToSupertype
import org.eclipse.emf.common.util.ECollections; //导入方法依赖的package包/类
/**
* Converts an {@link EList} of type T to an {@link EList} S, where S is a supertype of T.
*
* @param <S>
* original list type, supertype of T
* @param <T>
* target list type, subtype of S
* @param from
* list to convert
* @return converted list
*/
@SuppressWarnings("unchecked")
public static <S, T extends S> EList<S> convertToSupertype(final EList<T> from) {
if (from == null) {
return ECollections.emptyEList();
}
return (EList<S>) from;
}
示例15: getBundles
import org.eclipse.emf.common.util.ECollections; //导入方法依赖的package包/类
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @generated NOT
*/
@Override
public EList<String> getBundles ()
{
return ECollections.emptyEList ();
}