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.

LineNumberTag.java 1.2KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. /* *******************************************************************
  2. * Copyright (c) 2002 Contributors
  3. * All rights reserved.
  4. * This program and the accompanying materials are made available
  5. * under the terms of the Eclipse Public License v 2.0
  6. * which accompanies this distribution and is available at
  7. * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt
  8. *
  9. * Contributors:
  10. * PARC initial implementation
  11. * Andy Clement pushed down into bcel module
  12. * ******************************************************************/
  13. package org.aspectj.apache.bcel.generic;
  14. /**
  15. * we don't actually target instructions, but instructions target us.
  16. */
  17. public class LineNumberTag extends Tag {
  18. private final int lineNumber;
  19. public LineNumberTag(int lineNumber) {
  20. this.lineNumber = lineNumber;
  21. }
  22. public int getLineNumber() {
  23. return lineNumber;
  24. }
  25. public String toString() {
  26. return "line " + lineNumber;
  27. }
  28. public boolean equals(Object other) {
  29. if (!(other instanceof LineNumberTag)) return false;
  30. return lineNumber == ((LineNumberTag)other).lineNumber;
  31. }
  32. public int hashCode() {
  33. return lineNumber;
  34. }
  35. }