Java Code Examples for org.eclipse.emf.ecore.util.EcoreEList.UnmodifiableEList

The following are Jave code examples for showing how to use UnmodifiableEList of the org.eclipse.emf.ecore.util.EcoreEList class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
Example 1
Project: triquetrum   File: PortImpl.java   Source Code and License Vote up 5 votes
/**
 * <!-- begin-user-doc --> <!-- end-user-doc -->
 *
 * @generated NOT
 */
@Override
public EList<Relation> getInsideLinkedRelations() {
  List<Relation> relations = new ArrayList<>();
  for (Relation r : getLinkedRelations()) {
    if (getContainer().equals(r.getContainer())) {
      relations.add(r);
    }
  }
  return new EcoreEList.UnmodifiableEList(this, TriqPackage.eINSTANCE.getPort_InsideLinkedRelations(), relations.size(), relations.toArray());
}
 
Example 2
Project: triquetrum   File: PortImpl.java   Source Code and License Vote up 5 votes
/**
 * <!-- begin-user-doc --> <!-- end-user-doc -->
 *
 * @generated NOT
 */
@Override
public EList<Relation> getOutsideLinkedRelations() {
  List<Relation> relations = new ArrayList<>();
  for (Relation r : getLinkedRelations()) {
    if (getContainer().getContainer().equals(r.getContainer())) {
      relations.add(r);
    }
  }
  return new EcoreEList.UnmodifiableEList(this, TriqPackage.eINSTANCE.getPort_OutsideLinkedRelations(), relations.size(), relations.toArray());
}
 
Example 3
Project: eclipse-avro   File: EStoreEObjectImpl.java   Source Code and License Vote up 5 votes
@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);
  }
}
 
Example 4
Project: eclipse-avro   File: EStoreEObjectImpl.java   Source Code and License Vote up 5 votes
@Override
protected List<FeatureMap.Entry> delegateBasicList()
{
  int size = delegateSize();
  if (size == 0)
  {
    return ECollections.emptyEList();
  }
  else
  {
    Object[] data = eStore().toArray(owner, eStructuralFeature);
    return new EcoreEList.UnmodifiableEList<FeatureMap.Entry>(owner, eStructuralFeature, data.length, data);
  }
}
 
Example 5
Project: clickwatch   File: EStoreEObjectImpl.java   Source Code and License Vote up 5 votes
@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);
  }
}
 
Example 6
Project: clickwatch   File: EStoreEObjectImpl.java   Source Code and License Vote up 5 votes
@Override
protected List<FeatureMap.Entry> delegateBasicList()
{
  int size = delegateSize();
  if (size == 0)
  {
    return ECollections.emptyEList();
  }
  else
  {
    Object[] data = eStore().toArray(owner, eStructuralFeature);
    return new EcoreEList.UnmodifiableEList<FeatureMap.Entry>(owner, eStructuralFeature, data.length, data);
  }
}
 
Example 7
Project: emfviews   File: WeavingModelImpl.java   Source Code and License Vote up 5 votes
/**
 * <!-- begin-user-doc --> <!-- end-user-doc -->
 *
 * @generated NOT
 */
@Override
public EList<VirtualConcept> getVirtualConcepts() {
  ArrayList<VirtualConcept> virtualConcepts = new ArrayList<>();
  for (VirtualLink l : getVirtualLinks()) {
    if (l instanceof VirtualConcept) {
      virtualConcepts.add((VirtualConcept) l);
    }
  }
  return new EcoreEList.UnmodifiableEList<>(this,
                                            VirtualLinksPackage.eINSTANCE
                                                .getWeavingModel_VirtualConcepts(),
                                            virtualConcepts.size(), virtualConcepts.toArray());
}
 
Example 8
Project: emfviews   File: WeavingModelImpl.java   Source Code and License Vote up 5 votes
/**
 * <!-- begin-user-doc --> <!-- end-user-doc -->
 *
 * @generated NOT
 */
@Override
public EList<VirtualProperty> getVirtualProperties() {
  ArrayList<VirtualProperty> virtualProperties = new ArrayList<>();
  for (VirtualLink l : getVirtualLinks()) {
    if (l instanceof VirtualProperty) {
      virtualProperties.add((VirtualProperty) l);
    }
  }
  return new EcoreEList.UnmodifiableEList<>(this,
                                            VirtualLinksPackage.eINSTANCE
                                                .getWeavingModel_VirtualProperties(),
                                            virtualProperties.size(),
                                            virtualProperties.toArray());
}
 
Example 9
Project: emfviews   File: WeavingModelImpl.java   Source Code and License Vote up 5 votes
/**
 * <!-- begin-user-doc --> <!-- end-user-doc -->
 *
 * @generated NOT
 */
@Override
public EList<VirtualAssociation> getVirtualAssociations() {
  ArrayList<VirtualAssociation> virtualAssociations = new ArrayList<>();
  for (VirtualLink l : getVirtualLinks()) {
    if (l instanceof VirtualAssociation) {
      virtualAssociations.add((VirtualAssociation) l);
    }
  }
  return new EcoreEList.UnmodifiableEList<>(this,
                                            VirtualLinksPackage.eINSTANCE
                                                .getWeavingModel_VirtualAssociations(),
                                            virtualAssociations.size(),
                                            virtualAssociations.toArray());
}
 
Example 10
Project: emfviews   File: WeavingModelImpl.java   Source Code and License Vote up 5 votes
/**
 * <!-- begin-user-doc --> <!-- end-user-doc -->
 *
 * @generated NOT
 */
@Override
public EList<VirtualElement> getVirtualElements() {
  ArrayList<VirtualElement> virtualElements = new ArrayList<>();
  for (VirtualLink l : getVirtualLinks()) {
    if (l instanceof VirtualElement) {
      virtualElements.add((VirtualElement) l);
    }
  }
  return new EcoreEList.UnmodifiableEList<>(this,
                                            VirtualLinksPackage.eINSTANCE
                                                .getWeavingModel_VirtualElements(),
                                            virtualElements.size(), virtualElements.toArray());
}
 
Example 11
Project: emfviews   File: WeavingModelImpl.java   Source Code and License Vote up 5 votes
/**
 * <!-- begin-user-doc --> <!-- end-user-doc -->
 *
 * @generated NOT
 */
@Override
public EList<Filter> getFilters() {
  ArrayList<Filter> filters = new ArrayList<>();
  for (VirtualLink l : getVirtualLinks()) {
    if (l instanceof Filter) {
      filters.add((Filter) l);
    }
  }
  return new EcoreEList.UnmodifiableEList<>(this,
                                            VirtualLinksPackage.eINSTANCE
                                                .getWeavingModel_Filters(),
                                            filters.size(), filters.toArray());
}
 
Example 12
Project: emfviews   File: VirtualEClass.java   Source Code and License Vote up 5 votes
@Override
public EList<EStructuralFeature> getEStructuralFeatures() {
  // The return value must be castable to EStructuralFeature.Setting,
  // hence why we use an EcoreList.UnmodifiableElist
  List<EStructuralFeature> cs = getVisibleLocalFeatures();
  return new EcoreEList.UnmodifiableEList<>(
      this, EcorePackage.Literals.ECLASS__ESTRUCTURAL_FEATURES, cs.size(), cs.toArray());
}
 
Example 13
Project: emfviews   File: VirtualEClass.java   Source Code and License Vote up 5 votes
@Override
public EList<EStructuralFeature> getEAllStructuralFeatures() {
  // The return value must be castable to EStructuralFeature.Setting,
  // hence why we use an EcoreList.UnmodifiableElist
  List<EStructuralFeature> cs = getVisibleFeatures();
  return new EcoreEList.UnmodifiableEList<>(
      this, EcorePackage.Literals.ECLASS__ESTRUCTURAL_FEATURES, cs.size(), cs.toArray());
}
 
Example 14
Project: emfviews   File: VirtualEPackage.java   Source Code and License Vote up 5 votes
@Override
public EList<EClassifier> getEClassifiers() {
  // The return value must be castable to EStructuralFeature.Setting,
  // hence why we use an EcoreList.UnmodifiableElist
  List<EClassifier> cs = getNonFilteredClassifiers();
  return new EcoreEList.UnmodifiableEList<>(
      this, EcorePackage.Literals.EPACKAGE__ECLASSIFIERS, cs.size(), cs.toArray());
}