return listIterator();
}
protected EGenericType wrap(EClass eClass)
{
EGenericType eGenericType = EcoreFactory.eINSTANCE.createEGenericType();
eGenericType.setEClassifier(eClass);
return eGenericType;
}
protected EClass unwrap(EGenericType eGenericType)
{
EClassifier result = ((EGenericTypeImpl)eGenericType).basicGetERawType();
if (result instanceof EClass)
{
return (EClass)result;
}
else
{
return EcorePackage.Literals.EOBJECT;
}
}
@Override
protected void delegateAdd(int index, EClass eClass)
{
getEGenericSuperTypes().add(index, wrap(eClass));
}
@Override
protected void delegateClear()
{
getEGenericSuperTypes().clear();
}
@Override
protected void delegateAdd(EClass eClass)
{
getEGenericSuperTypes().add(wrap(eClass));
}
@Override
protected boolean delegateContains(Object object)
{
for (EClass eClass : this)
{
if (object == eClass)
{
return true;
}
}
return false;
}
@Override
protected boolean delegateContainsAll(Collection<?> collection)
{
for (Object object : collection)
{
if (!delegateContains(object))
{
return false;
}
}
return true;
}
@Override
protected boolean delegateEquals(Object object)
{
if (object instanceof List<?>)
{
List<?> list = (List<?>)object;
if (list.size() == delegateSize())
{
for (Iterator<?> i = list.iterator(), j = iterator(); i.hasNext(); )
{
if (i.next() != j.next())
{
return false;
}
}
return true;
}
}
return false;
}
@Override
protected EClass delegateGet(int index)
{
EGenericType eGenericType = getEGenericSuperTypes().get(index);
return unwrap(eGenericType);
}
@Override
protected int delegateHashCode()
{
int hashCode = 1;
for (EGenericType eGenericType : getEGenericSuperTypes())
{
Object object = unwrap(eGenericType);
hashCode = 31 * hashCode + (object == null ? 0 : object.hashCode());
}
return hashCode;
}
@Override
protected int delegateIndexOf(Object object)
{
int index = 0;
for (EGenericType eGenericType : getEGenericSuperTypes())
{
if (object == unwrap(eGenericType))
{
return index;
}
++index;
}
return -1;
}
@Override
protected boolean delegateIsEmpty()
{
return getEGenericSuperTypes().isEmpty();
}
@Override
protected int delegateLastIndexOf(Object object)
{
EList<EGenericType> eGenericSuperTypes = getEGenericSuperTypes();
for (int i = eGenericSuperTypes.size() - 1; i >= 0; --i)
{
if (unwrap(eGenericSuperTypes.get(i)) == object)
{
return i;
}
}
return -1;
}
@Override
protected EClass delegateRemove(int index)
{
EGenericType eGenericType = getEGenericSuperTypes().remove(index);
return unwrap(eGenericType);
}
@Override
protected EClass delegateSet(int index, EClass eClass)
{
EGenericType eGenericType = getEGenericSuperTypes().get(index);
EClass result = unwrap(eGenericType);
// If this is just a proxy being resolved...
//
if (resolveProxy(result) == eClass)
{
// Force the raw type to be resolved so we don't resolve this endlessly.
//
eGenericType.getERawType();
}
else
{
// Update the classifier and hence the raw type as normal.
//
eGenericType.setEClassifier(eClass);
}
return result;
}
@Override