You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

NewParentTypeMunger.java 1.7KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. /* *******************************************************************
  2. * Copyright (c) 2002 Palo Alto Research Center, Incorporated (PARC).
  3. * All rights reserved.
  4. * This program and the accompanying materials are made available
  5. * under the terms of the Eclipse Public License v1.0
  6. * which accompanies this distribution and is available at
  7. * http://www.eclipse.org/legal/epl-v10.html
  8. *
  9. * Contributors:
  10. * PARC initial implementation
  11. * ******************************************************************/
  12. package org.aspectj.weaver;
  13. import java.io.IOException;
  14. public class NewParentTypeMunger extends ResolvedTypeMunger {
  15. ResolvedType newParent;
  16. ResolvedType declaringType;
  17. private boolean isMixin;
  18. public NewParentTypeMunger(ResolvedType newParent, ResolvedType declaringType) {
  19. super(Parent, null);
  20. this.newParent = newParent;
  21. this.declaringType = declaringType;
  22. this.isMixin = false;
  23. }
  24. public void write(CompressingDataOutputStream s) throws IOException {
  25. throw new RuntimeException("unimplemented");
  26. }
  27. public ResolvedType getNewParent() {
  28. return newParent;
  29. }
  30. public boolean equals(Object other) {
  31. if (!(other instanceof NewParentTypeMunger)) {
  32. return false;
  33. }
  34. NewParentTypeMunger o = (NewParentTypeMunger) other;
  35. return newParent.equals(o.newParent) && isMixin == o.isMixin;
  36. }
  37. private volatile int hashCode = 0;
  38. public int hashCode() {
  39. if (hashCode == 0) {
  40. int result = 17;
  41. result = 37 * result + newParent.hashCode();
  42. result = 37 * result + (isMixin ? 0 : 1);
  43. hashCode = result;
  44. }
  45. return hashCode;
  46. }
  47. public ResolvedType getDeclaringType() {
  48. return declaringType;
  49. }
  50. public void setIsMixin(boolean b) {
  51. isMixin = true;
  52. }
  53. public boolean isMixin() {
  54. return isMixin;
  55. }
  56. }