001 /**
002 * <copyright>
003 * </copyright>
004 *
005 * $Id$
006 */
007 package com.hammurapi.party.impl;
008
009 import com.hammurapi.party.Party;
010 import com.hammurapi.party.PartyPackage;
011 import com.hammurapi.party.Tag;
012 import com.hammurapi.party.USAddress;
013
014 import java.util.Collection;
015 import java.util.Date;
016
017 import org.eclipse.emf.common.notify.Notification;
018 import org.eclipse.emf.common.notify.NotificationChain;
019
020 import org.eclipse.emf.common.util.EList;
021
022 import org.eclipse.emf.ecore.EClass;
023 import org.eclipse.emf.ecore.InternalEObject;
024
025 import org.eclipse.emf.ecore.impl.ENotificationImpl;
026 import org.eclipse.emf.ecore.impl.EObjectImpl;
027
028 import org.eclipse.emf.ecore.util.EObjectContainmentEList;
029 import org.eclipse.emf.ecore.util.EcoreUtil;
030 import org.eclipse.emf.ecore.util.InternalEList;
031
032 /**
033 * <!-- begin-user-doc -->
034 * An implementation of the model object '<em><b>US Address</b></em>'.
035 * <!-- end-user-doc -->
036 * <p>
037 * The following features are implemented:
038 * <ul>
039 * <li>{@link com.hammurapi.party.impl.USAddressImpl#getTags <em>Tags</em>}</li>
040 * <li>{@link com.hammurapi.party.impl.USAddressImpl#getComment <em>Comment</em>}</li>
041 * <li>{@link com.hammurapi.party.impl.USAddressImpl#getStart <em>Start</em>}</li>
042 * <li>{@link com.hammurapi.party.impl.USAddressImpl#getEnd <em>End</em>}</li>
043 * <li>{@link com.hammurapi.party.impl.USAddressImpl#getCategory <em>Category</em>}</li>
044 * <li>{@link com.hammurapi.party.impl.USAddressImpl#getOwner <em>Owner</em>}</li>
045 * <li>{@link com.hammurapi.party.impl.USAddressImpl#getCountry <em>Country</em>}</li>
046 * <li>{@link com.hammurapi.party.impl.USAddressImpl#getRecipient <em>Recipient</em>}</li>
047 * <li>{@link com.hammurapi.party.impl.USAddressImpl#getStreet1 <em>Street1</em>}</li>
048 * <li>{@link com.hammurapi.party.impl.USAddressImpl#getStreet2 <em>Street2</em>}</li>
049 * <li>{@link com.hammurapi.party.impl.USAddressImpl#getCity <em>City</em>}</li>
050 * <li>{@link com.hammurapi.party.impl.USAddressImpl#getState <em>State</em>}</li>
051 * <li>{@link com.hammurapi.party.impl.USAddressImpl#getZip <em>Zip</em>}</li>
052 * </ul>
053 * </p>
054 *
055 * @generated
056 */
057 public class USAddressImpl extends EObjectImpl implements USAddress {
058 /**
059 * The cached value of the '{@link #getTags() <em>Tags</em>}' containment reference list.
060 * <!-- begin-user-doc -->
061 * <!-- end-user-doc -->
062 * @see #getTags()
063 * @generated
064 * @ordered
065 */
066 protected EList<Tag> tags;
067
068 /**
069 * The default value of the '{@link #getComment() <em>Comment</em>}' attribute.
070 * <!-- begin-user-doc -->
071 * <!-- end-user-doc -->
072 * @see #getComment()
073 * @generated
074 * @ordered
075 */
076 protected static final String COMMENT_EDEFAULT = null;
077
078 /**
079 * The cached value of the '{@link #getComment() <em>Comment</em>}' attribute.
080 * <!-- begin-user-doc -->
081 * <!-- end-user-doc -->
082 * @see #getComment()
083 * @generated
084 * @ordered
085 */
086 protected String comment = COMMENT_EDEFAULT;
087
088 /**
089 * The default value of the '{@link #getStart() <em>Start</em>}' attribute.
090 * <!-- begin-user-doc -->
091 * <!-- end-user-doc -->
092 * @see #getStart()
093 * @generated
094 * @ordered
095 */
096 protected static final Date START_EDEFAULT = null;
097
098 /**
099 * The cached value of the '{@link #getStart() <em>Start</em>}' attribute.
100 * <!-- begin-user-doc -->
101 * <!-- end-user-doc -->
102 * @see #getStart()
103 * @generated
104 * @ordered
105 */
106 protected Date start = START_EDEFAULT;
107
108 /**
109 * The default value of the '{@link #getEnd() <em>End</em>}' attribute.
110 * <!-- begin-user-doc -->
111 * <!-- end-user-doc -->
112 * @see #getEnd()
113 * @generated
114 * @ordered
115 */
116 protected static final Date END_EDEFAULT = null;
117
118 /**
119 * The cached value of the '{@link #getEnd() <em>End</em>}' attribute.
120 * <!-- begin-user-doc -->
121 * <!-- end-user-doc -->
122 * @see #getEnd()
123 * @generated
124 * @ordered
125 */
126 protected Date end = END_EDEFAULT;
127
128 /**
129 * The default value of the '{@link #getCategory() <em>Category</em>}' attribute.
130 * <!-- begin-user-doc -->
131 * <!-- end-user-doc -->
132 * @see #getCategory()
133 * @generated
134 * @ordered
135 */
136 protected static final String CATEGORY_EDEFAULT = null;
137
138 /**
139 * The cached value of the '{@link #getCategory() <em>Category</em>}' attribute.
140 * <!-- begin-user-doc -->
141 * <!-- end-user-doc -->
142 * @see #getCategory()
143 * @generated
144 * @ordered
145 */
146 protected String category = CATEGORY_EDEFAULT;
147
148 /**
149 * The default value of the '{@link #getCountry() <em>Country</em>}' attribute.
150 * <!-- begin-user-doc -->
151 * <!-- end-user-doc -->
152 * @see #getCountry()
153 * @generated
154 * @ordered
155 */
156 protected static final String COUNTRY_EDEFAULT = null;
157
158 /**
159 * The cached value of the '{@link #getCountry() <em>Country</em>}' attribute.
160 * <!-- begin-user-doc -->
161 * <!-- end-user-doc -->
162 * @see #getCountry()
163 * @generated
164 * @ordered
165 */
166 protected String country = COUNTRY_EDEFAULT;
167
168 /**
169 * The default value of the '{@link #getRecipient() <em>Recipient</em>}' attribute.
170 * <!-- begin-user-doc -->
171 * <!-- end-user-doc -->
172 * @see #getRecipient()
173 * @generated
174 * @ordered
175 */
176 protected static final String RECIPIENT_EDEFAULT = null;
177
178 /**
179 * The cached value of the '{@link #getRecipient() <em>Recipient</em>}' attribute.
180 * <!-- begin-user-doc -->
181 * <!-- end-user-doc -->
182 * @see #getRecipient()
183 * @generated
184 * @ordered
185 */
186 protected String recipient = RECIPIENT_EDEFAULT;
187
188 /**
189 * The default value of the '{@link #getStreet1() <em>Street1</em>}' attribute.
190 * <!-- begin-user-doc -->
191 * <!-- end-user-doc -->
192 * @see #getStreet1()
193 * @generated
194 * @ordered
195 */
196 protected static final String STREET1_EDEFAULT = null;
197
198 /**
199 * The cached value of the '{@link #getStreet1() <em>Street1</em>}' attribute.
200 * <!-- begin-user-doc -->
201 * <!-- end-user-doc -->
202 * @see #getStreet1()
203 * @generated
204 * @ordered
205 */
206 protected String street1 = STREET1_EDEFAULT;
207
208 /**
209 * The default value of the '{@link #getStreet2() <em>Street2</em>}' attribute.
210 * <!-- begin-user-doc -->
211 * <!-- end-user-doc -->
212 * @see #getStreet2()
213 * @generated
214 * @ordered
215 */
216 protected static final String STREET2_EDEFAULT = null;
217
218 /**
219 * The cached value of the '{@link #getStreet2() <em>Street2</em>}' attribute.
220 * <!-- begin-user-doc -->
221 * <!-- end-user-doc -->
222 * @see #getStreet2()
223 * @generated
224 * @ordered
225 */
226 protected String street2 = STREET2_EDEFAULT;
227
228 /**
229 * The default value of the '{@link #getCity() <em>City</em>}' attribute.
230 * <!-- begin-user-doc -->
231 * <!-- end-user-doc -->
232 * @see #getCity()
233 * @generated
234 * @ordered
235 */
236 protected static final String CITY_EDEFAULT = null;
237
238 /**
239 * The cached value of the '{@link #getCity() <em>City</em>}' attribute.
240 * <!-- begin-user-doc -->
241 * <!-- end-user-doc -->
242 * @see #getCity()
243 * @generated
244 * @ordered
245 */
246 protected String city = CITY_EDEFAULT;
247
248 /**
249 * The default value of the '{@link #getState() <em>State</em>}' attribute.
250 * <!-- begin-user-doc -->
251 * <!-- end-user-doc -->
252 * @see #getState()
253 * @generated
254 * @ordered
255 */
256 protected static final String STATE_EDEFAULT = null;
257
258 /**
259 * The cached value of the '{@link #getState() <em>State</em>}' attribute.
260 * <!-- begin-user-doc -->
261 * <!-- end-user-doc -->
262 * @see #getState()
263 * @generated
264 * @ordered
265 */
266 protected String state = STATE_EDEFAULT;
267
268 /**
269 * The default value of the '{@link #getZip() <em>Zip</em>}' attribute.
270 * <!-- begin-user-doc -->
271 * <!-- end-user-doc -->
272 * @see #getZip()
273 * @generated
274 * @ordered
275 */
276 protected static final String ZIP_EDEFAULT = null;
277
278 /**
279 * The cached value of the '{@link #getZip() <em>Zip</em>}' attribute.
280 * <!-- begin-user-doc -->
281 * <!-- end-user-doc -->
282 * @see #getZip()
283 * @generated
284 * @ordered
285 */
286 protected String zip = ZIP_EDEFAULT;
287
288 /**
289 * <!-- begin-user-doc -->
290 * <!-- end-user-doc -->
291 * @generated
292 */
293 protected USAddressImpl() {
294 super();
295 }
296
297 /**
298 * <!-- begin-user-doc -->
299 * <!-- end-user-doc -->
300 * @generated
301 */
302 @Override
303 protected EClass eStaticClass() {
304 return PartyPackage.Literals.US_ADDRESS;
305 }
306
307 /**
308 * <!-- begin-user-doc -->
309 * <!-- end-user-doc -->
310 * @generated
311 */
312 public EList<Tag> getTags() {
313 if (tags == null) {
314 tags = new EObjectContainmentEList<Tag>(Tag.class, this, PartyPackage.US_ADDRESS__TAGS);
315 }
316 return tags;
317 }
318
319 /**
320 * <!-- begin-user-doc -->
321 * <!-- end-user-doc -->
322 * @generated
323 */
324 public String getComment() {
325 return comment;
326 }
327
328 /**
329 * <!-- begin-user-doc -->
330 * <!-- end-user-doc -->
331 * @generated
332 */
333 public void setComment(String newComment) {
334 String oldComment = comment;
335 comment = newComment;
336 if (eNotificationRequired())
337 eNotify(new ENotificationImpl(this, Notification.SET, PartyPackage.US_ADDRESS__COMMENT, oldComment, comment));
338 }
339
340 /**
341 * <!-- begin-user-doc -->
342 * <!-- end-user-doc -->
343 * @generated
344 */
345 public Date getStart() {
346 return start;
347 }
348
349 /**
350 * <!-- begin-user-doc -->
351 * <!-- end-user-doc -->
352 * @generated
353 */
354 public void setStart(Date newStart) {
355 Date oldStart = start;
356 start = newStart;
357 if (eNotificationRequired())
358 eNotify(new ENotificationImpl(this, Notification.SET, PartyPackage.US_ADDRESS__START, oldStart, start));
359 }
360
361 /**
362 * <!-- begin-user-doc -->
363 * <!-- end-user-doc -->
364 * @generated
365 */
366 public Date getEnd() {
367 return end;
368 }
369
370 /**
371 * <!-- begin-user-doc -->
372 * <!-- end-user-doc -->
373 * @generated
374 */
375 public void setEnd(Date newEnd) {
376 Date oldEnd = end;
377 end = newEnd;
378 if (eNotificationRequired())
379 eNotify(new ENotificationImpl(this, Notification.SET, PartyPackage.US_ADDRESS__END, oldEnd, end));
380 }
381
382 /**
383 * <!-- begin-user-doc -->
384 * <!-- end-user-doc -->
385 * @generated
386 */
387 public String getCategory() {
388 return category;
389 }
390
391 /**
392 * <!-- begin-user-doc -->
393 * <!-- end-user-doc -->
394 * @generated
395 */
396 public void setCategory(String newCategory) {
397 String oldCategory = category;
398 category = newCategory;
399 if (eNotificationRequired())
400 eNotify(new ENotificationImpl(this, Notification.SET, PartyPackage.US_ADDRESS__CATEGORY, oldCategory, category));
401 }
402
403 /**
404 * <!-- begin-user-doc -->
405 * <!-- end-user-doc -->
406 * @generated
407 */
408 public Party getOwner() {
409 if (eContainerFeatureID() != PartyPackage.US_ADDRESS__OWNER) return null;
410 return (Party)eContainer();
411 }
412
413 /**
414 * <!-- begin-user-doc -->
415 * <!-- end-user-doc -->
416 * @generated
417 */
418 public NotificationChain basicSetOwner(Party newOwner, NotificationChain msgs) {
419 msgs = eBasicSetContainer((InternalEObject)newOwner, PartyPackage.US_ADDRESS__OWNER, msgs);
420 return msgs;
421 }
422
423 /**
424 * <!-- begin-user-doc -->
425 * <!-- end-user-doc -->
426 * @generated
427 */
428 public void setOwner(Party newOwner) {
429 if (newOwner != eInternalContainer() || (eContainerFeatureID() != PartyPackage.US_ADDRESS__OWNER && newOwner != null)) {
430 if (EcoreUtil.isAncestor(this, newOwner))
431 throw new IllegalArgumentException("Recursive containment not allowed for " + toString());
432 NotificationChain msgs = null;
433 if (eInternalContainer() != null)
434 msgs = eBasicRemoveFromContainer(msgs);
435 if (newOwner != null)
436 msgs = ((InternalEObject)newOwner).eInverseAdd(this, PartyPackage.PARTY__CONTACT_INFO, Party.class, msgs);
437 msgs = basicSetOwner(newOwner, msgs);
438 if (msgs != null) msgs.dispatch();
439 }
440 else if (eNotificationRequired())
441 eNotify(new ENotificationImpl(this, Notification.SET, PartyPackage.US_ADDRESS__OWNER, newOwner, newOwner));
442 }
443
444 /**
445 * <!-- begin-user-doc -->
446 * <!-- end-user-doc -->
447 * @generated
448 */
449 public String getCountry() {
450 return country;
451 }
452
453 /**
454 * <!-- begin-user-doc -->
455 * <!-- end-user-doc -->
456 * @generated
457 */
458 public void setCountry(String newCountry) {
459 String oldCountry = country;
460 country = newCountry;
461 if (eNotificationRequired())
462 eNotify(new ENotificationImpl(this, Notification.SET, PartyPackage.US_ADDRESS__COUNTRY, oldCountry, country));
463 }
464
465 /**
466 * <!-- begin-user-doc -->
467 * <!-- end-user-doc -->
468 * @generated
469 */
470 public String getRecipient() {
471 return recipient;
472 }
473
474 /**
475 * <!-- begin-user-doc -->
476 * <!-- end-user-doc -->
477 * @generated
478 */
479 public void setRecipient(String newRecipient) {
480 String oldRecipient = recipient;
481 recipient = newRecipient;
482 if (eNotificationRequired())
483 eNotify(new ENotificationImpl(this, Notification.SET, PartyPackage.US_ADDRESS__RECIPIENT, oldRecipient, recipient));
484 }
485
486 /**
487 * <!-- begin-user-doc -->
488 * <!-- end-user-doc -->
489 * @generated
490 */
491 public String getStreet1() {
492 return street1;
493 }
494
495 /**
496 * <!-- begin-user-doc -->
497 * <!-- end-user-doc -->
498 * @generated
499 */
500 public void setStreet1(String newStreet1) {
501 String oldStreet1 = street1;
502 street1 = newStreet1;
503 if (eNotificationRequired())
504 eNotify(new ENotificationImpl(this, Notification.SET, PartyPackage.US_ADDRESS__STREET1, oldStreet1, street1));
505 }
506
507 /**
508 * <!-- begin-user-doc -->
509 * <!-- end-user-doc -->
510 * @generated
511 */
512 public String getStreet2() {
513 return street2;
514 }
515
516 /**
517 * <!-- begin-user-doc -->
518 * <!-- end-user-doc -->
519 * @generated
520 */
521 public void setStreet2(String newStreet2) {
522 String oldStreet2 = street2;
523 street2 = newStreet2;
524 if (eNotificationRequired())
525 eNotify(new ENotificationImpl(this, Notification.SET, PartyPackage.US_ADDRESS__STREET2, oldStreet2, street2));
526 }
527
528 /**
529 * <!-- begin-user-doc -->
530 * <!-- end-user-doc -->
531 * @generated
532 */
533 public String getCity() {
534 return city;
535 }
536
537 /**
538 * <!-- begin-user-doc -->
539 * <!-- end-user-doc -->
540 * @generated
541 */
542 public void setCity(String newCity) {
543 String oldCity = city;
544 city = newCity;
545 if (eNotificationRequired())
546 eNotify(new ENotificationImpl(this, Notification.SET, PartyPackage.US_ADDRESS__CITY, oldCity, city));
547 }
548
549 /**
550 * <!-- begin-user-doc -->
551 * <!-- end-user-doc -->
552 * @generated
553 */
554 public String getState() {
555 return state;
556 }
557
558 /**
559 * <!-- begin-user-doc -->
560 * <!-- end-user-doc -->
561 * @generated
562 */
563 public void setState(String newState) {
564 String oldState = state;
565 state = newState;
566 if (eNotificationRequired())
567 eNotify(new ENotificationImpl(this, Notification.SET, PartyPackage.US_ADDRESS__STATE, oldState, state));
568 }
569
570 /**
571 * <!-- begin-user-doc -->
572 * <!-- end-user-doc -->
573 * @generated
574 */
575 public String getZip() {
576 return zip;
577 }
578
579 /**
580 * <!-- begin-user-doc -->
581 * <!-- end-user-doc -->
582 * @generated
583 */
584 public void setZip(String newZip) {
585 String oldZip = zip;
586 zip = newZip;
587 if (eNotificationRequired())
588 eNotify(new ENotificationImpl(this, Notification.SET, PartyPackage.US_ADDRESS__ZIP, oldZip, zip));
589 }
590
591
592 /**
593 * <!-- begin-user-doc -->
594 * <!-- end-user-doc -->
595 * @generated NOT
596 */
597 public boolean isEffectiveNow() {
598 return isEffective(new Date());
599 }
600
601 /**
602 * <!-- begin-user-doc -->
603 * <!-- end-user-doc -->
604 * @generated NOT
605 */
606 public boolean isEffective(Date date) {
607 if (getStart()!=null && getStart().after(date)) {
608 return false;
609 }
610
611 if (getEnd()!=null && getEnd().before(date)) {
612 return false;
613 }
614
615 return true;
616 }
617
618 /**
619 * <!-- begin-user-doc -->
620 * <!-- end-user-doc -->
621 * @generated
622 */
623 @Override
624 public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
625 switch (featureID) {
626 case PartyPackage.US_ADDRESS__OWNER:
627 if (eInternalContainer() != null)
628 msgs = eBasicRemoveFromContainer(msgs);
629 return basicSetOwner((Party)otherEnd, msgs);
630 }
631 return super.eInverseAdd(otherEnd, featureID, msgs);
632 }
633
634 /**
635 * <!-- begin-user-doc -->
636 * <!-- end-user-doc -->
637 * @generated
638 */
639 @Override
640 public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
641 switch (featureID) {
642 case PartyPackage.US_ADDRESS__TAGS:
643 return ((InternalEList<?>)getTags()).basicRemove(otherEnd, msgs);
644 case PartyPackage.US_ADDRESS__OWNER:
645 return basicSetOwner(null, msgs);
646 }
647 return super.eInverseRemove(otherEnd, featureID, msgs);
648 }
649
650 /**
651 * <!-- begin-user-doc -->
652 * <!-- end-user-doc -->
653 * @generated
654 */
655 @Override
656 public NotificationChain eBasicRemoveFromContainerFeature(NotificationChain msgs) {
657 switch (eContainerFeatureID()) {
658 case PartyPackage.US_ADDRESS__OWNER:
659 return eInternalContainer().eInverseRemove(this, PartyPackage.PARTY__CONTACT_INFO, Party.class, msgs);
660 }
661 return super.eBasicRemoveFromContainerFeature(msgs);
662 }
663
664 /**
665 * <!-- begin-user-doc -->
666 * <!-- end-user-doc -->
667 * @generated
668 */
669 @Override
670 public Object eGet(int featureID, boolean resolve, boolean coreType) {
671 switch (featureID) {
672 case PartyPackage.US_ADDRESS__TAGS:
673 return getTags();
674 case PartyPackage.US_ADDRESS__COMMENT:
675 return getComment();
676 case PartyPackage.US_ADDRESS__START:
677 return getStart();
678 case PartyPackage.US_ADDRESS__END:
679 return getEnd();
680 case PartyPackage.US_ADDRESS__CATEGORY:
681 return getCategory();
682 case PartyPackage.US_ADDRESS__OWNER:
683 return getOwner();
684 case PartyPackage.US_ADDRESS__COUNTRY:
685 return getCountry();
686 case PartyPackage.US_ADDRESS__RECIPIENT:
687 return getRecipient();
688 case PartyPackage.US_ADDRESS__STREET1:
689 return getStreet1();
690 case PartyPackage.US_ADDRESS__STREET2:
691 return getStreet2();
692 case PartyPackage.US_ADDRESS__CITY:
693 return getCity();
694 case PartyPackage.US_ADDRESS__STATE:
695 return getState();
696 case PartyPackage.US_ADDRESS__ZIP:
697 return getZip();
698 }
699 return super.eGet(featureID, resolve, coreType);
700 }
701
702 /**
703 * <!-- begin-user-doc -->
704 * <!-- end-user-doc -->
705 * @generated
706 */
707 @SuppressWarnings("unchecked")
708 @Override
709 public void eSet(int featureID, Object newValue) {
710 switch (featureID) {
711 case PartyPackage.US_ADDRESS__TAGS:
712 getTags().clear();
713 getTags().addAll((Collection<? extends Tag>)newValue);
714 return;
715 case PartyPackage.US_ADDRESS__COMMENT:
716 setComment((String)newValue);
717 return;
718 case PartyPackage.US_ADDRESS__START:
719 setStart((Date)newValue);
720 return;
721 case PartyPackage.US_ADDRESS__END:
722 setEnd((Date)newValue);
723 return;
724 case PartyPackage.US_ADDRESS__CATEGORY:
725 setCategory((String)newValue);
726 return;
727 case PartyPackage.US_ADDRESS__OWNER:
728 setOwner((Party)newValue);
729 return;
730 case PartyPackage.US_ADDRESS__COUNTRY:
731 setCountry((String)newValue);
732 return;
733 case PartyPackage.US_ADDRESS__RECIPIENT:
734 setRecipient((String)newValue);
735 return;
736 case PartyPackage.US_ADDRESS__STREET1:
737 setStreet1((String)newValue);
738 return;
739 case PartyPackage.US_ADDRESS__STREET2:
740 setStreet2((String)newValue);
741 return;
742 case PartyPackage.US_ADDRESS__CITY:
743 setCity((String)newValue);
744 return;
745 case PartyPackage.US_ADDRESS__STATE:
746 setState((String)newValue);
747 return;
748 case PartyPackage.US_ADDRESS__ZIP:
749 setZip((String)newValue);
750 return;
751 }
752 super.eSet(featureID, newValue);
753 }
754
755 /**
756 * <!-- begin-user-doc -->
757 * <!-- end-user-doc -->
758 * @generated
759 */
760 @Override
761 public void eUnset(int featureID) {
762 switch (featureID) {
763 case PartyPackage.US_ADDRESS__TAGS:
764 getTags().clear();
765 return;
766 case PartyPackage.US_ADDRESS__COMMENT:
767 setComment(COMMENT_EDEFAULT);
768 return;
769 case PartyPackage.US_ADDRESS__START:
770 setStart(START_EDEFAULT);
771 return;
772 case PartyPackage.US_ADDRESS__END:
773 setEnd(END_EDEFAULT);
774 return;
775 case PartyPackage.US_ADDRESS__CATEGORY:
776 setCategory(CATEGORY_EDEFAULT);
777 return;
778 case PartyPackage.US_ADDRESS__OWNER:
779 setOwner((Party)null);
780 return;
781 case PartyPackage.US_ADDRESS__COUNTRY:
782 setCountry(COUNTRY_EDEFAULT);
783 return;
784 case PartyPackage.US_ADDRESS__RECIPIENT:
785 setRecipient(RECIPIENT_EDEFAULT);
786 return;
787 case PartyPackage.US_ADDRESS__STREET1:
788 setStreet1(STREET1_EDEFAULT);
789 return;
790 case PartyPackage.US_ADDRESS__STREET2:
791 setStreet2(STREET2_EDEFAULT);
792 return;
793 case PartyPackage.US_ADDRESS__CITY:
794 setCity(CITY_EDEFAULT);
795 return;
796 case PartyPackage.US_ADDRESS__STATE:
797 setState(STATE_EDEFAULT);
798 return;
799 case PartyPackage.US_ADDRESS__ZIP:
800 setZip(ZIP_EDEFAULT);
801 return;
802 }
803 super.eUnset(featureID);
804 }
805
806 /**
807 * <!-- begin-user-doc -->
808 * <!-- end-user-doc -->
809 * @generated
810 */
811 @Override
812 public boolean eIsSet(int featureID) {
813 switch (featureID) {
814 case PartyPackage.US_ADDRESS__TAGS:
815 return tags != null && !tags.isEmpty();
816 case PartyPackage.US_ADDRESS__COMMENT:
817 return COMMENT_EDEFAULT == null ? comment != null : !COMMENT_EDEFAULT.equals(comment);
818 case PartyPackage.US_ADDRESS__START:
819 return START_EDEFAULT == null ? start != null : !START_EDEFAULT.equals(start);
820 case PartyPackage.US_ADDRESS__END:
821 return END_EDEFAULT == null ? end != null : !END_EDEFAULT.equals(end);
822 case PartyPackage.US_ADDRESS__CATEGORY:
823 return CATEGORY_EDEFAULT == null ? category != null : !CATEGORY_EDEFAULT.equals(category);
824 case PartyPackage.US_ADDRESS__OWNER:
825 return getOwner() != null;
826 case PartyPackage.US_ADDRESS__COUNTRY:
827 return COUNTRY_EDEFAULT == null ? country != null : !COUNTRY_EDEFAULT.equals(country);
828 case PartyPackage.US_ADDRESS__RECIPIENT:
829 return RECIPIENT_EDEFAULT == null ? recipient != null : !RECIPIENT_EDEFAULT.equals(recipient);
830 case PartyPackage.US_ADDRESS__STREET1:
831 return STREET1_EDEFAULT == null ? street1 != null : !STREET1_EDEFAULT.equals(street1);
832 case PartyPackage.US_ADDRESS__STREET2:
833 return STREET2_EDEFAULT == null ? street2 != null : !STREET2_EDEFAULT.equals(street2);
834 case PartyPackage.US_ADDRESS__CITY:
835 return CITY_EDEFAULT == null ? city != null : !CITY_EDEFAULT.equals(city);
836 case PartyPackage.US_ADDRESS__STATE:
837 return STATE_EDEFAULT == null ? state != null : !STATE_EDEFAULT.equals(state);
838 case PartyPackage.US_ADDRESS__ZIP:
839 return ZIP_EDEFAULT == null ? zip != null : !ZIP_EDEFAULT.equals(zip);
840 }
841 return super.eIsSet(featureID);
842 }
843
844 /**
845 * <!-- begin-user-doc -->
846 * <!-- end-user-doc -->
847 * @generated
848 */
849 @Override
850 public String toString() {
851 if (eIsProxy()) return super.toString();
852
853 StringBuffer result = new StringBuffer(super.toString());
854 result.append(" (comment: ");
855 result.append(comment);
856 result.append(", start: ");
857 result.append(start);
858 result.append(", end: ");
859 result.append(end);
860 result.append(", category: ");
861 result.append(category);
862 result.append(", country: ");
863 result.append(country);
864 result.append(", recipient: ");
865 result.append(recipient);
866 result.append(", street1: ");
867 result.append(street1);
868 result.append(", street2: ");
869 result.append(street2);
870 result.append(", city: ");
871 result.append(city);
872 result.append(", state: ");
873 result.append(state);
874 result.append(", zip: ");
875 result.append(zip);
876 result.append(')');
877 return result.toString();
878 }
879
880 } //USAddressImpl