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.

Not.java 1.0KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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.ast;
  13. public class Not extends Test {
  14. Test test;
  15. public Not(Test test) {
  16. super();
  17. this.test = test;
  18. }
  19. public void accept(ITestVisitor v) {
  20. v.visit(this);
  21. }
  22. public Test getBody() {
  23. return test;
  24. }
  25. public String toString() {
  26. return "!" + test;
  27. }
  28. public boolean equals(Object other) {
  29. if (other instanceof Not) {
  30. Not o = (Not) other;
  31. return o.test.equals(test);
  32. } else {
  33. return false;
  34. }
  35. }
  36. public int hashCode() {
  37. return test.hashCode();
  38. }
  39. }