當前位置: 首頁>>代碼示例>>Java>>正文


Java BasicEList.add方法代碼示例

本文整理匯總了Java中org.eclipse.emf.common.util.BasicEList.add方法的典型用法代碼示例。如果您正苦於以下問題:Java BasicEList.add方法的具體用法?Java BasicEList.add怎麽用?Java BasicEList.add使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.eclipse.emf.common.util.BasicEList的用法示例。


在下文中一共展示了BasicEList.add方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: updatePart

import org.eclipse.emf.common.util.BasicEList; //導入方法依賴的package包/類
/**
 * {@inheritDoc}
 * @see org.eclipse.emf.eef.runtime.impl.components.StandardPropertiesEditionComponent#updatePart(org.eclipse.emf.common.notify.Notification)
 */
public void updatePart(Notification msg) {
	super.updatePart(msg);
	if (editingPart.isVisible()) {
		TimingPropertiesEditionPart timingPart = (TimingPropertiesEditionPart)editingPart;
		if (HrmPackage.eINSTANCE.getHardwareResource_Clock().equals(msg.getFeature()) && timingPart != null && isAccessible(HrmViewsRepository.Timing.TimingProperties.clock))
			timingPart.setClock((EObject)msg.getNewValue());
		if (HrmPackage.eINSTANCE.getHardwareMemory_Timings().equals(msg.getFeature()) && msg.getNotifier().equals(semanticObject) && timingPart != null && isAccessible(HrmViewsRepository.Timing.TimingProperties.timings)) {
			if (msg.getNewValue() instanceof EList<?>) {
				timingPart.setTimings((EList<?>)msg.getNewValue());
			} else if (msg.getNewValue() == null) {
				timingPart.setTimings(new BasicEList<Object>());
			} else {
				BasicEList<Object> newValueAsList = new BasicEList<Object>();
				newValueAsList.add(msg.getNewValue());
				timingPart.setTimings(newValueAsList);
			}
		}
		
		
	}
}
 
開發者ID:polarsys,項目名稱:time4sys,代碼行數:26,代碼來源:HardwareDriveTimingPropertiesEditionComponent.java

示例2: getValues

import org.eclipse.emf.common.util.BasicEList; //導入方法依賴的package包/類
@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);
}
 
開發者ID:eclipse,項目名稱:xtext-extras,代碼行數:24,代碼來源:JvmAnnotationReferenceImplCustom.java

示例3: mockSelectedElement

import org.eclipse.emf.common.util.BasicEList; //導入方法依賴的package包/類
/**
 * 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;
}
 
開發者ID:dsldevkit,項目名稱:dsl-devkit,代碼行數:38,代碼來源:EObjectContentProviderTest.java

示例4: addAllUnique

import org.eclipse.emf.common.util.BasicEList; //導入方法依賴的package包/類
public boolean addAllUnique(int index, Entry.Internal [] entries, int start, int end)
{
  modCount = -1;
  BasicEList<Entry.Internal> collection = new BasicEList<Entry.Internal>();
  if (start == 0)
  {
    collection.setData(end, entries);
  }
  else
  {
    collection.grow(end - start);
    for (int i = start; i < end; ++i)
    {
      collection.add(entries[i]);
    }
  }
  return featureMap.addAllUnique(index, collection);
}
 
開發者ID:LangleyStudios,項目名稱:eclipse-avro,代碼行數:19,代碼來源:FeatureMapUtil.java

示例5: getKnownInputs

import org.eclipse.emf.common.util.BasicEList; //導入方法依賴的package包/類
/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * 
 * @generated NOT
 */
@Override
public EList<InputSpecification> getKnownInputs ()
{
    if ( this.knownInputs == null )
    {
        final BasicEList<InputSpecification> inputs = ECollections.newBasicEList ();
        inputs.add ( Components.createInput ( "input" ) );
        this.knownInputs = ECollections.unmodifiableEList ( inputs );
    }
    return this.knownInputs;
}
 
開發者ID:eclipse,項目名稱:neoscada,代碼行數:18,代碼來源:AverageModuleImpl.java

示例6: getKnownOutputs

import org.eclipse.emf.common.util.BasicEList; //導入方法依賴的package包/類
/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * 
 * @generated NOT
 */
@Override
public EList<OutputSpecification> getKnownOutputs ()
{
    if ( this.knownOutputs == null )
    {
        final BasicEList<OutputSpecification> outputs = ECollections.newBasicEList ();
        for ( final AverageReferenceType type : AverageReferenceType.values () )
        {
            outputs.add ( Components.createOutput ( type.getLiteral (), DataType.FLOAT ) );
        }
        this.knownOutputs = ECollections.unmodifiableEList ( outputs );
    }
    return this.knownOutputs;
}
 
開發者ID:eclipse,項目名稱:neoscada,代碼行數:21,代碼來源:AverageModuleImpl.java

示例7: getKnownOutputs

import org.eclipse.emf.common.util.BasicEList; //導入方法依賴的package包/類
/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * 
 * @generated NOT
 */
@Override
public EList<OutputSpecification> getKnownOutputs ()
{
    if ( this.knownOutputs == null )
    {
        final BasicEList<OutputSpecification> outputs = ECollections.newBasicEList ();
        outputs.add ( Components.createOutput ( "output", null ) );
        this.knownOutputs = ECollections.unmodifiableEList ( outputs );
    }
    return this.knownOutputs;
}
 
開發者ID:eclipse,項目名稱:neoscada,代碼行數:18,代碼來源:FormulaModuleImpl.java

示例8: getKnownInputs

import org.eclipse.emf.common.util.BasicEList; //導入方法依賴的package包/類
/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 *
 * @generated NOT
 */
@Override
public EList<InputSpecification> getKnownInputs ()
{
    if ( this.knownInputs == null )
    {
        final BasicEList<InputSpecification> inputs = ECollections.newBasicEList ();
        inputs.add ( Components.createInput ( "input" ) );
        this.knownInputs = ECollections.unmodifiableEList ( inputs );
    }
    return this.knownInputs;
}
 
開發者ID:eclipse,項目名稱:neoscada,代碼行數:18,代碼來源:MovingAverageModuleImpl.java

示例9: getKnownOutputs

import org.eclipse.emf.common.util.BasicEList; //導入方法依賴的package包/類
/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 *
 * @generated NOT
 */
@Override
public EList<OutputSpecification> getKnownOutputs ()
{
    if ( this.knownOutputs == null )
    {
        final BasicEList<OutputSpecification> outputs = ECollections.newBasicEList ();
        for ( final MovingAverageReferenceType type : MovingAverageReferenceType.values () )
        {
            outputs.add ( Components.createOutput ( type.getLiteral (), DataType.FLOAT ) );
        }
        this.knownOutputs = ECollections.unmodifiableEList ( outputs );
    }
    return this.knownOutputs;
}
 
開發者ID:eclipse,項目名稱:neoscada,代碼行數:21,代碼來源:MovingAverageModuleImpl.java

示例10: getSources

import org.eclipse.emf.common.util.BasicEList; //導入方法依賴的package包/類
/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated NOT
 */
public EList<EObject> getSources(final String role) {
	if (role == null) {
		throw new IllegalArgumentException("role must not be null");
	}
	final BasicEList<EObject> result = new BasicEList<>();
	for(MappableArtefact artefact: getSources()) {
		if (role.equals(artefact.getName())) {
			result.add(artefact.getValue());
		}
	}
	return result;
}
 
開發者ID:polarsys,項目名稱:time4sys,代碼行數:18,代碼來源:LinkImpl.java

示例11: getTargets

import org.eclipse.emf.common.util.BasicEList; //導入方法依賴的package包/類
/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated NOT
 */
public EList<EObject> getTargets(String role) {
	if (role == null) {
		throw new IllegalArgumentException("role must not be null");
	}
	final BasicEList<EObject> result = new BasicEList<>();
	for(MappableArtefact artefact: getTargets()) {
		if (role.equals(artefact.getName())) {
			result.add(artefact.getValue());
		}
	}
	return result;
}
 
開發者ID:polarsys,項目名稱:time4sys,代碼行數:18,代碼來源:LinkImpl.java

示例12: updatePart

import org.eclipse.emf.common.util.BasicEList; //導入方法依賴的package包/類
/**
 * {@inheritDoc}
 * @see org.eclipse.emf.eef.runtime.impl.components.StandardPropertiesEditionComponent#updatePart(org.eclipse.emf.common.notify.Notification)
 */
public void updatePart(Notification msg) {
	super.updatePart(msg);
	if (editingPart.isVisible()) {
		TimingPropertiesEditionPart timingPart = (TimingPropertiesEditionPart)editingPart;
		if (GrmPackage.eINSTANCE.getResourceManager_ResCtrlPolicy().equals(msg.getFeature()) && isAccessible(SrmViewsRepository.Timing.Properties.resCtrlPolicy))
			timingPart.updateResCtrlPolicy();
		if (SrmPackage.eINSTANCE.getSoftwareConcurrentResource_PriorityElements().equals(msg.getFeature()) && msg.getNotifier().equals(semanticObject) && timingPart != null && isAccessible(SrmViewsRepository.Timing.Properties.priorityElements)) {
			if (msg.getNewValue() instanceof EList<?>) {
				timingPart.setPriorityElements((EList<?>)msg.getNewValue());
			} else if (msg.getNewValue() == null) {
				timingPart.setPriorityElements(new BasicEList<Object>());
			} else {
				BasicEList<Object> newValueAsList = new BasicEList<Object>();
				newValueAsList.add(msg.getNewValue());
				timingPart.setPriorityElements(newValueAsList);
			}
		}
		
		if (SrmPackage.eINSTANCE.getSoftwareConcurrentResource_MutualExclusionResources().equals(msg.getFeature())  && isAccessible(SrmViewsRepository.Timing.Properties.mutualExclusionResources))
			timingPart.updateMutualExclusionResources();
		if (SrmPackage.eINSTANCE.getSoftwareConcurrentResource_ArrivalPattern().equals(msg.getFeature()) && msg.getNotifier().equals(semanticObject) && timingPart != null && isAccessible(SrmViewsRepository.Timing.Properties.arrivalPattern)) {
			if (msg.getNewValue() != null) {
				timingPart.setArrivalPattern(EcoreUtil.convertToString(EcorePackage.Literals.ESTRING, msg.getNewValue()));
			} else {
				timingPart.setArrivalPattern("");
			}
		}
		if (SrmPackage.eINSTANCE.getAlarm_Timers().equals(msg.getFeature())  && isAccessible(SrmViewsRepository.Timing.Properties.timers))
			timingPart.updateTimers();
		
	}
}
 
開發者ID:polarsys,項目名稱:time4sys,代碼行數:37,代碼來源:AlarmTimingPropertiesEditionComponent.java

示例13: updatePart

import org.eclipse.emf.common.util.BasicEList; //導入方法依賴的package包/類
/**
 * {@inheritDoc}
 * @see org.eclipse.emf.eef.runtime.impl.components.StandardPropertiesEditionComponent#updatePart(org.eclipse.emf.common.notify.Notification)
 */
public void updatePart(Notification msg) {
	super.updatePart(msg);
	if (editingPart.isVisible()) {
		TimingPropertiesEditionPart timingPart = (TimingPropertiesEditionPart)editingPart;
		if (GrmPackage.eINSTANCE.getResourceManager_ResCtrlPolicy().equals(msg.getFeature()) && isAccessible(SrmViewsRepository.Timing.Properties.resCtrlPolicy))
			timingPart.updateResCtrlPolicy();
		if (SrmPackage.eINSTANCE.getSoftwareConcurrentResource_PriorityElements().equals(msg.getFeature()) && msg.getNotifier().equals(semanticObject) && timingPart != null && isAccessible(SrmViewsRepository.Timing.Properties.priorityElements)) {
			if (msg.getNewValue() instanceof EList<?>) {
				timingPart.setPriorityElements((EList<?>)msg.getNewValue());
			} else if (msg.getNewValue() == null) {
				timingPart.setPriorityElements(new BasicEList<Object>());
			} else {
				BasicEList<Object> newValueAsList = new BasicEList<Object>();
				newValueAsList.add(msg.getNewValue());
				timingPart.setPriorityElements(newValueAsList);
			}
		}
		
		if (SrmPackage.eINSTANCE.getSoftwareConcurrentResource_MutualExclusionResources().equals(msg.getFeature())  && isAccessible(SrmViewsRepository.Timing.Properties.mutualExclusionResources))
			timingPart.updateMutualExclusionResources();
		if (SrmPackage.eINSTANCE.getSoftwareConcurrentResource_ArrivalPattern().equals(msg.getFeature()) && msg.getNotifier().equals(semanticObject) && timingPart != null && isAccessible(SrmViewsRepository.Timing.Properties.arrivalPattern)) {
			if (msg.getNewValue() != null) {
				timingPart.setArrivalPattern(EcoreUtil.convertToString(EcorePackage.Literals.ESTRING, msg.getNewValue()));
			} else {
				timingPart.setArrivalPattern("");
			}
		}
		
	}
}
 
開發者ID:polarsys,項目名稱:time4sys,代碼行數:35,代碼來源:InterruptResourceTimingPropertiesEditionComponent.java

示例14: updatePart

import org.eclipse.emf.common.util.BasicEList; //導入方法依賴的package包/類
/**
 * {@inheritDoc}
 * @see org.eclipse.emf.eef.runtime.impl.components.StandardPropertiesEditionComponent#updatePart(org.eclipse.emf.common.notify.Notification)
 */
public void updatePart(Notification msg) {
	super.updatePart(msg);
	if (editingPart.isVisible()) {
		TimingPropertiesEditionPart timingPart = (TimingPropertiesEditionPart)editingPart;
		if (GrmPackage.eINSTANCE.getTimerResource_Duration().equals(msg.getFeature()) && msg.getNotifier().equals(semanticObject) && timingPart != null && isAccessible(SrmViewsRepository.Timing.Properties.duration)) {
			if (msg.getNewValue() != null) {
				timingPart.setDuration(EcoreUtil.convertToString(EcorePackage.Literals.EFLOAT, msg.getNewValue()));
			} else {
				timingPart.setDuration("");
			}
		}
		if (GrmPackage.eINSTANCE.getTimerResource_IsPeriodic().equals(msg.getFeature()) && msg.getNotifier().equals(semanticObject) && timingPart != null && isAccessible(SrmViewsRepository.Timing.Properties.isPeriodic))
			timingPart.setIsPeriodic((Boolean)msg.getNewValue());
		
		if (SrmPackage.eINSTANCE.getSoftwareTimerResource_DurationElements().equals(msg.getFeature()) && msg.getNotifier().equals(semanticObject) && timingPart != null && isAccessible(SrmViewsRepository.Timing.Properties.durationElements)) {
			if (msg.getNewValue() instanceof EList<?>) {
				timingPart.setDurationElements((EList<?>)msg.getNewValue());
			} else if (msg.getNewValue() == null) {
				timingPart.setDurationElements(new BasicEList<Object>());
			} else {
				BasicEList<Object> newValueAsList = new BasicEList<Object>();
				newValueAsList.add(msg.getNewValue());
				timingPart.setDurationElements(newValueAsList);
			}
		}
		
		
	}
}
 
開發者ID:polarsys,項目名稱:time4sys,代碼行數:34,代碼來源:SoftwareTimerResourceTimingPropertiesEditionComponent.java

示例15: updatePart

import org.eclipse.emf.common.util.BasicEList; //導入方法依賴的package包/類
/**
 * {@inheritDoc}
 * @see org.eclipse.emf.eef.runtime.impl.components.StandardPropertiesEditionComponent#updatePart(org.eclipse.emf.common.notify.Notification)
 */
public void updatePart(Notification msg) {
	super.updatePart(msg);
	if (editingPart.isVisible()) {
		TimingPropertiesEditionPart timingPart = (TimingPropertiesEditionPart)editingPart;
		if (HrmPackage.eINSTANCE.getHardwareResource_Clock().equals(msg.getFeature()) && timingPart != null && isAccessible(HrmViewsRepository.Timing.TimingProperties.clock))
			timingPart.setClock((EObject)msg.getNewValue());
		if (HrmPackage.eINSTANCE.getHardwareMemory_Timings().equals(msg.getFeature()) && msg.getNotifier().equals(semanticObject) && timingPart != null && isAccessible(HrmViewsRepository.Timing.TimingProperties.timings)) {
			if (msg.getNewValue() instanceof EList<?>) {
				timingPart.setTimings((EList<?>)msg.getNewValue());
			} else if (msg.getNewValue() == null) {
				timingPart.setTimings(new BasicEList<Object>());
			} else {
				BasicEList<Object> newValueAsList = new BasicEList<Object>();
				newValueAsList.add(msg.getNewValue());
				timingPart.setTimings(newValueAsList);
			}
		}
		
		if (HrmPackage.eINSTANCE.getHardwareProcessingMemory_ReplPolicy().equals(msg.getFeature()) && msg.getNotifier().equals(semanticObject) && isAccessible(HrmViewsRepository.Timing.TimingProperties.replPolicy))
			timingPart.setReplPolicy((ReplPolicy)msg.getNewValue());
		
		if (HrmPackage.eINSTANCE.getHardwareProcessingMemory_WritePolicy().equals(msg.getFeature()) && msg.getNotifier().equals(semanticObject) && isAccessible(HrmViewsRepository.Timing.TimingProperties.writePolicy))
			timingPart.setWritePolicy((WritePolicy)msg.getNewValue());
		
		
	}
}
 
開發者ID:polarsys,項目名稱:time4sys,代碼行數:32,代碼來源:HardwareCacheTimingPropertiesEditionComponent.java


注:本文中的org.eclipse.emf.common.util.BasicEList.add方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。