📄 libraryimpl.java
字号:
}
};
}
return books;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EList getBranches()
{
if (branches == null)
{
branches = new EObjectContainmentWithInverseEList(Library.class, this, EXTLibraryPackage.LIBRARY__BRANCHES, EXTLibraryPackage.LIBRARY__PARENT_BRANCH);
}
return branches;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Library getParentBranch()
{
if (eContainerFeatureID != EXTLibraryPackage.LIBRARY__PARENT_BRANCH) return null;
return (Library)eContainer();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetParentBranch(Library newParentBranch, NotificationChain msgs)
{
msgs = eBasicSetContainer((InternalEObject)newParentBranch, EXTLibraryPackage.LIBRARY__PARENT_BRANCH, msgs);
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setParentBranch(Library newParentBranch)
{
if (newParentBranch != eInternalContainer() || (eContainerFeatureID != EXTLibraryPackage.LIBRARY__PARENT_BRANCH && newParentBranch != null))
{
if (EcoreUtil.isAncestor(this, newParentBranch))
throw new IllegalArgumentException("Recursive containment not allowed for " + toString()); //$NON-NLS-1$
NotificationChain msgs = null;
if (eInternalContainer() != null)
msgs = eBasicRemoveFromContainer(msgs);
if (newParentBranch != null)
msgs = ((InternalEObject)newParentBranch).eInverseAdd(this, EXTLibraryPackage.LIBRARY__BRANCHES, Library.class, msgs);
msgs = basicSetParentBranch(newParentBranch, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, EXTLibraryPackage.LIBRARY__PARENT_BRANCH, newParentBranch, newParentBranch));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public FeatureMap getPeople()
{
if (people == null)
{
people = new BasicFeatureMap(this, EXTLibraryPackage.LIBRARY__PEOPLE);
}
return people;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs)
{
switch (featureID)
{
case EXTLibraryPackage.LIBRARY__BRANCHES:
return ((InternalEList)getBranches()).basicAdd(otherEnd, msgs);
case EXTLibraryPackage.LIBRARY__PARENT_BRANCH:
if (eInternalContainer() != null)
msgs = eBasicRemoveFromContainer(msgs);
return basicSetParentBranch((Library)otherEnd, msgs);
}
return super.eInverseAdd(otherEnd, featureID, msgs);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
{
switch (featureID)
{
case EXTLibraryPackage.LIBRARY__WRITERS:
return ((InternalEList)getWriters()).basicRemove(otherEnd, msgs);
case EXTLibraryPackage.LIBRARY__EMPLOYEES:
return ((InternalEList)getEmployees()).basicRemove(otherEnd, msgs);
case EXTLibraryPackage.LIBRARY__BORROWERS:
return ((InternalEList)getBorrowers()).basicRemove(otherEnd, msgs);
case EXTLibraryPackage.LIBRARY__STOCK:
return ((InternalEList)getStock()).basicRemove(otherEnd, msgs);
case EXTLibraryPackage.LIBRARY__BRANCHES:
return ((InternalEList)getBranches()).basicRemove(otherEnd, msgs);
case EXTLibraryPackage.LIBRARY__PARENT_BRANCH:
return basicSetParentBranch(null, msgs);
case EXTLibraryPackage.LIBRARY__PEOPLE:
return ((InternalEList)getPeople()).basicRemove(otherEnd, msgs);
}
return super.eInverseRemove(otherEnd, featureID, msgs);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain eBasicRemoveFromContainerFeature(NotificationChain msgs)
{
switch (eContainerFeatureID)
{
case EXTLibraryPackage.LIBRARY__PARENT_BRANCH:
return eInternalContainer().eInverseRemove(this, EXTLibraryPackage.LIBRARY__BRANCHES, Library.class, msgs);
}
return super.eBasicRemoveFromContainerFeature(msgs);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Object eGet(int featureID, boolean resolve, boolean coreType)
{
switch (featureID)
{
case EXTLibraryPackage.LIBRARY__ADDRESS:
return getAddress();
case EXTLibraryPackage.LIBRARY__NAME:
return getName();
case EXTLibraryPackage.LIBRARY__WRITERS:
return getWriters();
case EXTLibraryPackage.LIBRARY__EMPLOYEES:
return getEmployees();
case EXTLibraryPackage.LIBRARY__BORROWERS:
return getBorrowers();
case EXTLibraryPackage.LIBRARY__STOCK:
return getStock();
case EXTLibraryPackage.LIBRARY__BOOKS:
return getBooks();
case EXTLibraryPackage.LIBRARY__BRANCHES:
return getBranches();
case EXTLibraryPackage.LIBRARY__PARENT_BRANCH:
return getParentBranch();
case EXTLibraryPackage.LIBRARY__PEOPLE:
if (coreType) return getPeople();
return ((FeatureMap.Internal)getPeople()).getWrapper();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void eSet(int featureID, Object newValue)
{
switch (featureID)
{
case EXTLibraryPackage.LIBRARY__ADDRESS:
setAddress((String)newValue);
return;
case EXTLibraryPackage.LIBRARY__NAME:
setName((String)newValue);
return;
case EXTLibraryPackage.LIBRARY__WRITERS:
getWriters().clear();
getWriters().addAll((Collection)newValue);
return;
case EXTLibraryPackage.LIBRARY__EMPLOYEES:
getEmployees().clear();
getEmployees().addAll((Collection)newValue);
return;
case EXTLibraryPackage.LIBRARY__BORROWERS:
getBorrowers().clear();
getBorrowers().addAll((Collection)newValue);
return;
case EXTLibraryPackage.LIBRARY__STOCK:
getStock().clear();
getStock().addAll((Collection)newValue);
return;
case EXTLibraryPackage.LIBRARY__BOOKS:
getBooks().clear();
getBooks().addAll((Collection)newValue);
return;
case EXTLibraryPackage.LIBRARY__BRANCHES:
getBranches().clear();
getBranches().addAll((Collection)newValue);
return;
case EXTLibraryPackage.LIBRARY__PARENT_BRANCH:
setParentBranch((Library)newValue);
return;
case EXTLibraryPackage.LIBRARY__PEOPLE:
((FeatureMap.Internal)getPeople()).set(newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void eUnset(int featureID)
{
switch (featureID)
{
case EXTLibraryPackage.LIBRARY__ADDRESS:
setAddress(ADDRESS_EDEFAULT);
return;
case EXTLibraryPackage.LIBRARY__NAME:
setName(NAME_EDEFAULT);
return;
case EXTLibraryPackage.LIBRARY__WRITERS:
getWriters().clear();
return;
case EXTLibraryPackage.LIBRARY__EMPLOYEES:
getEmployees().clear();
return;
case EXTLibraryPackage.LIBRARY__BORROWERS:
getBorrowers().clear();
return;
case EXTLibraryPackage.LIBRARY__STOCK:
getStock().clear();
return;
case EXTLibraryPackage.LIBRARY__BOOKS:
getBooks().clear();
return;
case EXTLibraryPackage.LIBRARY__BRANCHES:
getBranches().clear();
return;
case EXTLibraryPackage.LIBRARY__PARENT_BRANCH:
setParentBranch((Library)null);
return;
case EXTLibraryPackage.LIBRARY__PEOPLE:
getPeople().clear();
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public boolean eIsSet(int featureID)
{
switch (featureID)
{
case EXTLibraryPackage.LIBRARY__ADDRESS:
return ADDRESS_EDEFAULT == null ? address != null : !ADDRESS_EDEFAULT.equals(address);
case EXTLibraryPackage.LIBRARY__NAME:
return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
case EXTLibraryPackage.LIBRARY__WRITERS:
return !getWriters().isEmpty();
case EXTLibraryPackage.LIBRARY__EMPLOYEES:
return !getEmployees().isEmpty();
case EXTLibraryPackage.LIBRARY__BORROWERS:
return !getBorrowers().isEmpty();
case EXTLibraryPackage.LIBRARY__STOCK:
return stock != null && !stock.isEmpty();
case EXTLibraryPackage.LIBRARY__BOOKS:
return books != null && !books.isEmpty();
case EXTLibraryPackage.LIBRARY__BRANCHES:
return branches != null && !branches.isEmpty();
case EXTLibraryPackage.LIBRARY__PARENT_BRANCH:
return getParentBranch() != null;
case EXTLibraryPackage.LIBRARY__PEOPLE:
return people != null && !people.isEmpty();
}
return super.eIsSet(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public String toString()
{
if (eIsProxy()) return super.toString();
StringBuffer result = new StringBuffer(super.toString());
result.append(" (address: "); //$NON-NLS-1$
result.append(address);
result.append(", name: "); //$NON-NLS-1$
result.append(name);
result.append(", people: "); //$NON-NLS-1$
result.append(people);
result.append(')');
return result.toString();
}
} //LibraryImpl
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -