本文整理汇总了Java中org.eclipse.emf.common.util.BasicEList.shrink方法的典型用法代码示例。如果您正苦于以下问题:Java BasicEList.shrink方法的具体用法?Java BasicEList.shrink怎么用?Java BasicEList.shrink使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.emf.common.util.BasicEList
的用法示例。
在下文中一共展示了BasicEList.shrink方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getEAllContainments
import org.eclipse.emf.common.util.BasicEList; //导入方法依赖的package包/类
public EList<EReference> getEAllContainments()
{
if (eAllContainments == null)
{
BasicEList<EReference> result =
new UniqueEList<EReference>()
{
private static final long serialVersionUID = 1L;
@Override
protected Object [] newData(int capacity)
{
return new EReference [capacity];
}
@Override
protected boolean useEquals()
{
return false;
}
};
for (EReference eReference : getEAllReferences())
{
if (eReference.isContainment())
{
result.add(eReference);
}
}
result.shrink();
eAllContainments =
new EcoreEList.UnmodifiableEList.FastCompare<EReference>
(this, EcorePackage.eINSTANCE.getEClass_EAllContainments(), result.size(), result.data());
getESuperAdapter().setAllContainmentsCollectionModified(false);
}
return eAllContainments;
}
示例2: getEAllReferences
import org.eclipse.emf.common.util.BasicEList; //导入方法依赖的package包/类
public EList<EReference> getEAllReferences()
{
if (eAllReferences == null)
{
class ReferenceList extends UniqueEList<EReference>
{
private static final long serialVersionUID = 1L;
public ReferenceList()
{
super();
}
@Override
protected Object [] newData(int capacity)
{
return new EReference [capacity];
}
@Override
protected boolean useEquals()
{
return false;
}
}
BasicEList<EReference> result = new ReferenceList();
BasicEList<EReference> references = new ReferenceList();
Set<EClass> computationInProgress = COMPUTATION_IN_PROGRESS.get();
if (computationInProgress.add(this))
{
for (EClass eSuperType : getESuperTypes())
{
result.addAll(eSuperType.getEAllReferences());
}
computationInProgress.remove(this);
if (computationInProgress.isEmpty())
{
COMPUTATION_IN_PROGRESS.remove();
}
}
for (EStructuralFeature eStructuralFeature : getEStructuralFeatures())
{
if (eStructuralFeature instanceof EReference)
{
references.add((EReference)eStructuralFeature);
}
}
references.shrink();
eReferences =
new EcoreEList.UnmodifiableEList.FastCompare<EReference>
(this, EcorePackage.eINSTANCE.getEClass_EReferences(), references.size(), references.data())
{
private static final long serialVersionUID = 1L;
@SuppressWarnings("unchecked")
@Override
public void addUnique(EReference object)
{
((InternalEList<EReference>)(InternalEList<?>)getEStructuralFeatures()).addUnique(object);
}
@Override
public boolean add(EReference object)
{
System.err.println("Please fix your code to add using EClass.getEStructuralFeatures() instead of EClass.getEReferences()");
return getEStructuralFeatures().add(object);
}
};
result.addAll(eReferences);
result.shrink();
eAllReferences =
new EcoreEList.UnmodifiableEList.FastCompare<EReference>
(this, EcorePackage.eINSTANCE.getEClass_EAllReferences(), result.size(), result.data());
getESuperAdapter().setAllReferencesCollectionModified(false);
}
return eAllReferences;
}
示例3: getEAllOperations
import org.eclipse.emf.common.util.BasicEList; //导入方法依赖的package包/类
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated modifiable
*/
public EList<EOperation> getEAllOperations()
{
if (eAllOperations == null)
{
BasicEList<EOperation> result =
new UniqueEList<EOperation>()
{
private static final long serialVersionUID = 1L;
@Override
protected Object [] newData(int capacity)
{
return new EOperation [capacity];
}
@Override
protected boolean useEquals()
{
return false;
}
};
Set<EClass> computationInProgress = COMPUTATION_IN_PROGRESS.get();
if (computationInProgress.add(this))
{
for (EClass eSuperType : getESuperTypes())
{
result.addAll(eSuperType.getEAllOperations());
}
computationInProgress.remove(this);
if (computationInProgress.isEmpty())
{
COMPUTATION_IN_PROGRESS.remove();
}
}
int operationID = result.size();
for (Iterator<EOperation> i = getEOperations().iterator(); i.hasNext(); ++operationID)
{
((EOperationImpl)i.next()).setOperationID(operationID);
}
result.addAll(getEOperations());
result.shrink();
eAllOperations =
new EcoreEList.UnmodifiableEList.FastCompare<EOperation>
(this, EcorePackage.eINSTANCE.getEClass_EAllOperations(), result.size(), result.data());
eAllOperationsData = (EOperation[])result.data();
if (eAllOperationsData == null)
{
eAllOperationsData = NO_EALL_OPERATIONS_DATA;
}
eOperationToOverrideMap = null;
getESuperAdapter().setAllOperationsCollectionModified(false);
}
return eAllOperations;
}
示例4: getEAllSuperTypes
import org.eclipse.emf.common.util.BasicEList; //导入方法依赖的package包/类
/**
* Returns all the super types in the hierarchy.
*/
public EList<EClass> getEAllSuperTypes()
{
if (eAllSuperTypes == null)
{
BasicEList<EClass> result =
new UniqueEList<EClass>()
{
private static final long serialVersionUID = 1L;
@Override
protected Object [] newData(int capacity)
{
return new EClassifier [capacity];
}
@Override
protected boolean useEquals()
{
return false;
}
};
Set<EClass> computationInProgress = COMPUTATION_IN_PROGRESS.get();
if (computationInProgress.add(this))
{
for (EClass eSuperType : getESuperTypes())
{
EList<EClass> higherSupers = eSuperType.getEAllSuperTypes();
result.addAll(higherSupers);
result.add(eSuperType);
}
computationInProgress.remove(this);
}
result.shrink();
eAllSuperTypes =
new EcoreEList.UnmodifiableEList.FastCompare<EClass>
(this, EcorePackage.eINSTANCE.getEClass_EAllSuperTypes(), result.size(), result.data());
getESuperAdapter().setAllSuperCollectionModified(false);
}
return eAllSuperTypes;
}